public class KeycloakAuthentication
extends org.acegisecurity.providers.AbstractAuthenticationToken
| Constructor and Description |
|---|
KeycloakAuthentication(org.keycloak.representations.IDToken idToken,
org.keycloak.representations.AccessToken accessToken,
String refreshToken,
org.keycloak.representations.AccessTokenResponse tokenResponse)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
String |
getAccessToken()
Get the keycloak access token
|
org.keycloak.representations.AccessTokenResponse |
getAccessTokenResponse()
Returns the latest AccessTokenResponse
|
Object |
getCredentials() |
Date |
getLastRefresh()
Get the date the token is from
|
Calendar |
getLastRefreshDateAsCalendar()
Get the date the token is from
|
String |
getName() |
Object |
getPrincipal() |
String |
getRefreshToken()
Get the keycloak refresh token
|
boolean |
isAccessExpired()
Checks whether the access token is expired or not.
|
boolean |
isRefreshExpired()
Checks whether the refresh token is expired or not.
|
void |
setAccessToken(String accessToken)
Sets the access token
|
void |
setAccessTokenResponse(org.keycloak.representations.AccessTokenResponse accessTokenResponse)
Sets the latest AccessTokenResponse
|
void |
setLastRefresh(Date lastRefresh)
Set the date the token is from
|
void |
setRefreshToken(String refreshToken)
Sets the refresh token
|
equals, getAuthorities, getDetails, hashCode, isAuthenticated, setAuthenticated, setDetails, toStringpublic KeycloakAuthentication(org.keycloak.representations.IDToken idToken,
org.keycloak.representations.AccessToken accessToken,
String refreshToken,
org.keycloak.representations.AccessTokenResponse tokenResponse)
idToken - the keycloak id tokenaccessToken - the keycloak access tokenrefreshToken - the keycloak refresh tokentokenResponse - the AccessTokenResponsepublic String getName()
public Object getCredentials()
public Object getPrincipal()
public String getRefreshToken()
String the refresh tokenpublic String getAccessToken()
String the access tokenpublic void setRefreshToken(String refreshToken)
refreshToken - Stringpublic void setAccessToken(String accessToken)
accessToken - Stringpublic org.keycloak.representations.AccessTokenResponse getAccessTokenResponse()
AccessTokenResponsepublic void setAccessTokenResponse(org.keycloak.representations.AccessTokenResponse accessTokenResponse)
accessTokenResponse - public Calendar getLastRefreshDateAsCalendar()
Calendarpublic void setLastRefresh(Date lastRefresh)
lastRefresh - public boolean isRefreshExpired()
public boolean isAccessExpired()
Copyright © 2016–2017. All rights reserved.