spring-boot-react-oauth2-social-login-demo icon indicating copy to clipboard operation
spring-boot-react-oauth2-social-login-demo copied to clipboard

adding linkdin provider issue

Open owahi opened this issue 4 years ago • 2 comments

i tried to add authentification for linkdin, but LinkedIn OAuth2 access token api is returning only the access_token and expires_in values but not the token_type in the response. This results in the following error.

org.springframework.http.converter.HttpMessageNotReadableException: An error occurred reading the OAuth 2.0 Access Token Response: tokenType cannot be null; nested exception is java.lang.IllegalArgumentException: tokenType cannot be null

can you suggest a solution please !

owahi avatar Dec 03 '19 09:12 owahi

@owahi Probably unrelated to this specific tutorial. Unfortunately, Spring's error-reporting regarding the tokenType parameter in auth-token response, is not the most verbose.

This could mean that either, the provider does not return a proper tokenType (see org.springframework.security.oauth2.core.OAuth2AccessToken.TokenType) or that some provider setting is misconfigured.

I'd suggest to double-check your config. Otherwise, try to set a debug breakpoint in org.springframework.security.oauth2.core.OAuth2AccessToken's constructor and/or check org.springframework.security.oauth2.core.endpoint.OAuth2AccessTokenResponse#accessToken for null.

See also:

  • https://tools.ietf.org/html/rfc6749#section-7.1
  • https://tools.ietf.org/html/rfc6749#section-5.1

frne avatar Dec 13 '19 19:12 frne

thank you @frne for your awnser.

owahi avatar Dec 16 '19 14:12 owahi