Object OAuth2Helper

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final static Instant getAccessTokenExpirationTime(String url) Returns the expiration time of the OAuth2 access token for the given url.
      final static Instant getRefreshTokenExpirationTime(String url) Returns the expiration time of the OAuth2 refresh token for the given url.
      final static OAuth2Token renewOAuth2Token(String url, Boolean forceRefresh) Renews the OAuth2 token for the given url.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • 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.