spring-boot-react-oauth2-social-login-demo
spring-boot-react-oauth2-social-login-demo copied to clipboard
adding linkdin provider issue
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 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
thank you @frne for your awnser.