public class TokenProvider extends Object
| Constructor and Description |
|---|
TokenProvider(AuthnConfigBuilder authnConfigBuilder) |
| Modifier and Type | Method and Description |
|---|---|
org.keycloak.representations.AccessTokenResponse |
getAccessToken()
Gets the access token based on the configured
grant_type. |
org.keycloak.representations.AccessTokenResponse |
getAccessToken(String username,
String password)
Gets access token using the given username and password.
|
org.keycloak.representations.AccessToken |
verifyToken(String tokenStr)
Verifies token.Typically called after successful tokenResponse is received from Keycloak.
|
public TokenProvider(AuthnConfigBuilder authnConfigBuilder)
public org.keycloak.representations.AccessTokenResponse getAccessToken()
grant_type.
If the grant_type is set to 'password', gets the access token using the configured username and password.
If the grant_type is set to 'client_credentials', gets the access token using the configured credentials secret.
public org.keycloak.representations.AccessTokenResponse getAccessToken(String username, String password)
username - the usernamepassword - the passwordpublic org.keycloak.representations.AccessToken verifyToken(String tokenStr)
AccessToken or null
if the validate-token property is set to false.Copyright © 2019. All rights reserved.