authorizationGrantType cannot be null in Spring Security 5 OAuth Client and Spring Boot 2.0

混江龙づ霸主 提交于 2019-12-04 05:14:00

To elaborate on OP's update above, the properties you need to include in your application.yaml to resolve the original error are as shown below, in this case for Azure AD (note this ONLY works with Spring Security 5, NOT Spring Security OAuth2 2.x whose functionality is being merged directly into Spring Security 5):

spring:
  security:
    oauth2:
      client:
        registration:
          microsoft:
            client-id: a935ba7b-6aa4-4b0c-9e84-04f9acaa477b
            client-secret: redacted
            authorization-grant-type: authorization_code
            redirect-uri-template: '{baseUrl}/login/oauth2/code/{registrationId}'
            scope: User.Read
            client-name: Microsoft
            client-alias: microsoft
        provider:
          microsoft:
            authorization-uri: https://login.microsoftonline.com/common/oauth2/authorize?resource=https://graph.microsoft.com/
            token-uri: https://login.microsoftonline.com/common/oauth2/token
            user-info-uri: https://graph.microsoft.com/v1.0/me
            user-name-attribute: sub
            jwk-set-uri: https://login.microsoftonline.com/common/discovery/keys
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!