Announcement Announcement Module
Collapse
No announcement yet.
Spring Social Google and applyAuthentication Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring Social Google and applyAuthentication

    Hi,

    I noticed that applyAuthentication(client) was removed in favour of getAccessToken, which doesn't actually do anything. I'm not entirely sure why I was using applyAuthentication(client) in the first place but since I'm now getting a 401 response, it's a fair bet that the issue might be related.

    The specific message I get is:

    org.springframework.web.client.RestClientException : No authentication header information

    Any suggestions?

    Kind regards,
    Marc

  • #2
    I'll defer to others to answer this. Be aware that Spring Social Google is a community-led project and (aside from having tinkered with it a little) I am not aware of the implementation decisions that went into it.

    Comment


    • #3
      So, it turned out to be a combination of things:
      1. I used an outdated version of google-oauth-client. Updated to 1.14.1-beta
      2. I didn't use google-api-client and I tried to use a way that didn't work

      So, the correct way to apply the authentication is:

      PHP Code:
      ContactsService client = new ContactsService("myLabel");    
      Credential credential = new GoogleCredential();
      credential.setAccessToken(go.getAccessToken());            
      client.setOAuth2Credentials(credential); 

      Comment

      Working...
      X