Package org.gcube.event.publisher
Class HTTPWithOIDCAuthEventSender
java.lang.Object
org.gcube.event.publisher.AbstractHTTPWithJWTTokenAuthEventSender
org.gcube.event.publisher.HTTPWithOIDCAuthEventSender
- All Implemented Interfaces:
EventSender
public class HTTPWithOIDCAuthEventSender
extends AbstractHTTPWithJWTTokenAuthEventSender
implements EventSender
Event sender authorized with the client credentials grant of the OIDC client, through d4science-iam-client. The token
is kept until shortly before it expires.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.gcube.event.publisher.AbstractHTTPWithJWTTokenAuthEventSender
AbstractHTTPWithJWTTokenAuthEventSender.HTTPGet, AbstractHTTPWithJWTTokenAuthEventSender.HTTPPost, AbstractHTTPWithJWTTokenAuthEventSender.HTTPVerb -
Field Summary
Fields inherited from class org.gcube.event.publisher.AbstractHTTPWithJWTTokenAuthEventSender
baseEndpointURL, clientId, clientSecret, connectionTimeout, lastHTTPGet, lastHTTPPost, log, readTimeout, tokenURL -
Constructor Summary
ConstructorsConstructorDescriptionHTTPWithOIDCAuthEventSender(URL baseEndpointURL, String clientId, String clientSecret, URL tokenURL) -
Method Summary
Modifier and TypeMethodDescriptionprotected StringGives the access token (the raw JWT string, without theBearerprefix) to authorize the next request.Methods inherited from class org.gcube.event.publisher.AbstractHTTPWithJWTTokenAuthEventSender
getConnectionTimeout, getLastRetrieveHTTPResponseCode, getLastSendHTTPResponseCode, getReadTimeout, getTokenURL, retrive, send, sendAndGetResult, setConnectionTimeout, setReadTimeoutMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.gcube.event.publisher.EventSender
getLastRetrieveHTTPResponseCode, getLastSendHTTPResponseCode, retrive, send, sendAndGetResult
-
Constructor Details
-
HTTPWithOIDCAuthEventSender
-
-
Method Details
-
getAuthorizationToken
Description copied from class:AbstractHTTPWithJWTTokenAuthEventSenderGives the access token (the raw JWT string, without theBearerprefix) to authorize the next request. It is called at every attempt, so implementations should cache it until it expires.- Specified by:
getAuthorizationTokenin classAbstractHTTPWithJWTTokenAuthEventSender- Returns:
- the access token, or
nullto send the request without authorization - Throws:
EventSenderAuthException- if the token cannot be obtained
-