Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find out the valid values to use for authorized grant types in Spring Secrity

I want to allow a client to use a specific grant type, but cannot find the valid values to use in the client table in the documentation.

Any ideas?

like image 913
Dirk Jablonski Avatar asked May 29 '17 13:05

Dirk Jablonski


1 Answers

Very good question - I struggled to find the values for hours.

Here is how to gather the different values. Every implementation of AbstractTokenGranter carries static field grant type GRANT_TYPE:

  • refresh_token - RefreshTokenGranter
  • authorization_code - AuthorizationCodeTokenGranter
  • implicit - ImplicitTokenGranter
  • password - ResourceOwnerPasswordTokenGranter
  • client_credentials - ClientCredentialsTokenGranter

The authorized grant types of a client can be found in the client instance via ClientDetails.getAuthorizedGrantTypes

And last but not least spring security oauth follows the specification here - so the grant types mentioned above match those mentioned in the spec.

like image 82
Mathias Dpunkt Avatar answered Oct 18 '22 06:10

Mathias Dpunkt