Class OAuth2Client


  • public class OAuth2Client
    extends Object
    A client for accessing an OAuth2 token endpoint. Synchronised for concurrent access, and supports keeping the same token active until it expires.
    Author:
    Matthew Gill
    • Method Detail

      • authenticate

        public jakarta.ws.rs.core.Response authenticate()
        Get the response from an authentication request. Caches the value until the expiration time elapses if it's configured.
        Returns:
        the most recent valid authentication response, or a new one if required.
      • expire

        public void expire​(Duration expiryTime)
        Configure the authentication request expiry time.
        Parameters:
        expiryTime -