Class OAuth2Client
- java.lang.Object
-
- fish.payara.microprofile.config.extensions.oauth.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
-
-
Constructor Summary
Constructors Constructor Description OAuth2Client(String authUrl, String referrer, Map<? extends Serializable,? extends Serializable> data)
OAuth2Client(String authUrl, Map<? extends Serializable,? extends Serializable> data)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description jakarta.ws.rs.core.Response
authenticate()
Get the response from an authentication request.void
expire(Duration expiryTime)
Configure the authentication request expiry time.
-
-
-
Constructor Detail
-
OAuth2Client
public OAuth2Client(String authUrl, String referrer, Map<? extends Serializable,? extends Serializable> data)
-
OAuth2Client
public OAuth2Client(String authUrl, Map<? extends Serializable,? extends Serializable> data)
-
-
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
-
-
-