Object OAuth2Helper
-
- All Implemented Interfaces:
public class OAuth2Helper
-
-
Field Summary
Fields Modifier and Type Field Description public final static OAuth2HelperINSTANCE
-
Method Summary
Modifier and Type Method Description final static InstantgetAccessTokenExpirationTime(String url)Returns the expiration time of the OAuth2 access token for the given url. final static InstantgetRefreshTokenExpirationTime(String url)Returns the expiration time of the OAuth2 refresh token for the given url. final static OAuth2TokenrenewOAuth2Token(String url, Boolean forceRefresh)Renews the OAuth2 token for the given url. -
-
Method Detail
-
getAccessTokenExpirationTime
final static Instant getAccessTokenExpirationTime(String url)
Returns the expiration time of the OAuth2 access token for the given url.
- Parameters:
url- the URL for introspecting the access token, if null, the backend URL from SettingsProvider.get is used.- Returns:
the expiration time if the access token is successfully introspected, otherwise null.
-
getRefreshTokenExpirationTime
final static Instant getRefreshTokenExpirationTime(String url)
Returns the expiration time of the OAuth2 refresh token for the given url.
- Parameters:
url- the URL for introspecting the refresh token, if null, the backend URL from SettingsProvider.get is used.- Returns:
the expiration time if the refresh token is successfully introspected, otherwise null.
-
renewOAuth2Token
final static OAuth2Token renewOAuth2Token(String url, Boolean forceRefresh)
Renews the OAuth2 token for the given url.
- Parameters:
url- the URL for renewing the token, if null, the backend URL from SettingsProvider.get is used.forceRefresh- if true, it will renew the refresh token and access token, otherwise it will only try to renew the access token.- Returns:
the new OAuth2Token if the token is successfully renewed, otherwise null.
-
-
-
-