Skip to content

Instantly share code, notes, and snippets.

@JonasGroeger
Last active April 29, 2020 06:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JonasGroeger/d32b6e67e6ee38465c4dab44fa7a2486 to your computer and use it in GitHub Desktop.
Save JonasGroeger/d32b6e67e6ee38465c4dab44fa7a2486 to your computer and use it in GitHub Desktop.
OAuth 2 grant types enum for Spring apps
public enum OAuth2GrantTypes {
// See https://docs.spring.io/spring-security/site/docs/current/api/org/springframework/security/oauth2/core/AuthorizationGrantType.html
AUTHORIZATION_CODE("authorization_code"),
IMPLICIT("implicit"),
PASSWORD("password"),
CLIENT_CREDENTIALS("client_credentials"),
REFRESH_TOKEN("refresh_token");
// Currently not supported by Spring Security
// https://tools.ietf.org/html/draft-ietf-oauth-device-flow-01
// DEVICE_CODE("device_code")
private final String name;
OAuth2GrantTypes(String name) {
this.name = name;
}
public String getName() {
return name;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment