-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Description
Summary
Adding scope: https://www.googleapis.com/auth/contacts.readonly to google oauth2 login generating following exception -
org.springframework.security.oauth2.core.OAuth2AuthenticationException: [invalid_user_info_response] An error occurred while attempting to retrieve the UserInfo Resource: Could not extract response: no suitable HttpMessageConverter found for response type [java.util.Map<java.lang.String, java.lang.Object>] and content type [text/plain]
Actual Behavior
I am able to authenticate and authorize user without giving any scope but as soon as I add scope: https://www.googleapis.com/auth/contacts.readonly in application.yml, its throwing Could not extract response: no suitable HttpMessageConverter found for response type [java.util.Map<java.lang.String, java.lang.Object>] and content type [text/plain] exception.
Expected Behavior
It shouldnt have thrown the exception
Configuration
application.yml
oauth2:
client:
registration:
google:
client-id: <>
client-secret: <>
scope: https://www.googleapis.com/auth/contacts.readonly
provider:
google:
user-info-uri: https://www.googleapis.com/auth/contacts.readonly?alt=json
Version
I am using Spring boot 2.3.0.RELEASE and Spring security 5.3.2.RELEASE