TokenCacheItem Class
- java.
lang. Object - Serializable
- com.
microsoft. aad. adal. TokenCacheItem
- com.
public class TokenCacheItem
Extended result to store more info Queries will be performed over this item not the key.
Constructor Summary
Constructor | Description |
---|---|
TokenCacheItem() |
Default constructor for cache item. |
Method Summary
Modifier and Type | Method and Description |
---|---|
Token |
createFRRTTokenCacheItem(final String authority, final AuthenticationResult authResult)
Create FRT token cache entry. Will not store clientId, resource and AT. |
Token |
createMRRTTokenCacheItem(final String authority, final String clientId, final AuthenticationResult authResult)
Create MRRT token cache item. Will not store AT and resource in the token cache. |
Token |
createRegularTokenCacheItem(final String authority, final String resource, final String clientId, final AuthenticationResult authResult)
Create regular RT token cache item. |
String |
getAccessToken()
Get the access token. |
String |
getAuthority()
Get the authority. |
String |
getClientId()
Get the client identifier. |
Date |
getExpiresOn()
Get the expire date. |
final Date |
getExtendedExpiresOn()
Get the extended expired time. |
final String |
getFamilyClientId()
Get family client identifier. |
boolean |
getIsMultiResourceRefreshToken()
Get the multi-resource refresh token flag. |
String |
getRawIdToken()
Get raw ID token. |
String |
getRefreshToken()
Get the refresh token string. |
String |
getResource()
Get the resource. |
String | getSpeRing() |
String |
getTenantId()
Get tenant identifier. |
final Date | getTokenUpdateTime() |
User |
getUserInfo()
Get the user information. |
final boolean |
isExtendedLifetimeValid()
Verify if the token cache token is valid for the extended expired time. |
boolean |
isTokenExpired(final Date expiresOn)
Checks expiration time. |
void |
setAccessToken(String accessToken)
Set the access token string. |
void |
setAuthority(String authority)
Set the authority. |
void |
setClientId(String clientId)
Set the client identifier. |
void |
setExpiresOn(final Date expiresOn)
Set the expire date. |
final void |
setExtendedExpiresOn(final Date extendedExpiresOn)
Set the extended expired time. |
final void |
setFamilyClientId(final String familyClientId)
Set family client identifier. |
void |
setIsMultiResourceRefreshToken(boolean isMultiResourceRefreshToken)
Set the multi-resource refresh token flag. |
void |
setRawIdToken(String rawIdToken)
Set raw ID token. |
void |
setRefreshToken(String refreshToken)
Set the fresh token string. |
void |
setResource(String resource)
Set the resource. |
void |
setTenantId(String tenantId)
Set tenant identifier. |
void |
setUserInfo(UserInfo info)
Set the user information. |
Constructor Details
TokenCacheItem
public TokenCacheItem()
Default constructor for cache item.
Method Details
createFRRTTokenCacheItem
public static TokenCacheItem createFRRTTokenCacheItem(final String authority, final AuthenticationResult authResult)
Create FRT token cache entry. Will not store clientId, resource and AT.
Parameters:
Returns:
createMRRTTokenCacheItem
public static TokenCacheItem createMRRTTokenCacheItem(final String authority, final String clientId, final AuthenticationResult authResult)
Create MRRT token cache item. Will not store AT and resource in the token cache.
Parameters:
Returns:
createRegularTokenCacheItem
public static TokenCacheItem createRegularTokenCacheItem(final String authority, final String resource, final String clientId, final AuthenticationResult authResult)
Create regular RT token cache item.
Parameters:
Returns:
getAccessToken
public String getAccessToken()
Get the access token.
Returns:
getAuthority
public String getAuthority()
Get the authority.
Returns:
getClientId
public String getClientId()
Get the client identifier.
Returns:
getExpiresOn
public Date getExpiresOn()
Get the expire date.
Returns:
getExtendedExpiresOn
public final Date getExtendedExpiresOn()
Get the extended expired time.
Returns:
getFamilyClientId
public final String getFamilyClientId()
Get family client identifier.
Returns:
getIsMultiResourceRefreshToken
public boolean getIsMultiResourceRefreshToken()
Get the multi-resource refresh token flag.
Returns:
getRawIdToken
public String getRawIdToken()
Get raw ID token.
Returns:
getRefreshToken
public String getRefreshToken()
Get the refresh token string.
Returns:
getResource
public String getResource()
Get the resource.
Returns:
getSpeRing
public String getSpeRing()
getTenantId
public String getTenantId()
Get tenant identifier.
Returns:
getTokenUpdateTime
protected final Date getTokenUpdateTime()
getUserInfo
public UserInfo getUserInfo()
Get the user information.
Returns:
isExtendedLifetimeValid
public final boolean isExtendedLifetimeValid()
Verify if the token cache token is valid for the extended expired time.
Returns:
isTokenExpired
public static boolean isTokenExpired(final Date expiresOn)
Checks expiration time.
Parameters:
Returns:
setAccessToken
public void setAccessToken(String accessToken)
Set the access token string.
Parameters:
setAuthority
public void setAuthority(String authority)
Set the authority.
Parameters:
setClientId
public void setClientId(String clientId)
Set the client identifier.
Parameters:
setExpiresOn
public void setExpiresOn(final Date expiresOn)
Set the expire date.
Parameters:
setExtendedExpiresOn
public final void setExtendedExpiresOn(final Date extendedExpiresOn)
Set the extended expired time.
Parameters:
setFamilyClientId
public final void setFamilyClientId(final String familyClientId)
Set family client identifier.
Parameters:
setIsMultiResourceRefreshToken
public void setIsMultiResourceRefreshToken(boolean isMultiResourceRefreshToken)
Set the multi-resource refresh token flag.
Parameters:
setRawIdToken
public void setRawIdToken(String rawIdToken)
Set raw ID token.
Parameters:
setRefreshToken
public void setRefreshToken(String refreshToken)
Set the fresh token string.
Parameters:
setResource
public void setResource(String resource)
Set the resource.
Parameters:
setTenantId
public void setTenantId(String tenantId)
Set tenant identifier.
Parameters:
setUserInfo
public void setUserInfo(UserInfo info)
Set the user information.
Parameters:
Applies to
Azure SDK for Java
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for