使用Spring security oauth2遇到的问题

在使用spring security oauth2过程中客户端DEBUG中总是有警告信息:

Could not fetch user details: class org.springframework.security.oauth2.common.exceptions.InvalidRequestException, Possible CSRF detected - state parameter was required but no state could be found

检查后发现原来在配置oauth2信息中:

security:
  oauth2:
    client:
      clientId: testclient
      clientSecret: 1234567890
      accessTokenUri: http://localhost:8080/oauth/token
      userAuthorizationUri: http://localhost:8080/oauth/authorize
#      tokenName: oauth_token
#      authenticationScheme: query
      clientAuthenticationScheme: form
    resource:
      userInfoUri: http://localhost:8081/resource/user


clientAuthenticationScheme: form 被注释了导致的,把注释去掉就不在有这个警告信息了,不知道是什么原理,有知道的请告知一下


你可能感兴趣的:(使用Spring security oauth2遇到的问题)