OAuthExtension

com.github.cloudfiles.core.http.auth.OAuthExtension

An actor implementation supporting an OAuth flow when interacting with an HTTP server.

This actor class wraps an com.github.cloudfiles.core.http.HttpRequestSender actor and adds a bearer token obtained from an OAuth identity provider to HTTP requests. The actor is configured with the parameters of an OAuth identity provider. When a request arrives, an authorization header with the current access token is added before the request is forwarded to the actual HTTP request actor. If the response has status code 401 (indicating that the access token is no longer valid), a request to refresh the token is sent to the IDP. The access token is then updated.

Token refresh operations and their outcome can be monitored, so that clients can take additional actions, e.g. store a new access token for later reuse.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def apply(requestSender: ActorRef[HttpCommand], idpRequestSender: ActorRef[HttpCommand], oauthConfig: OAuthConfig): Behavior[HttpCommand]

Creates a new actor instance with the parameters provided.

Creates a new actor instance with the parameters provided.

Value parameters

idpRequestSender

an ''HttpRequestSender'' to contact the IDP

oauthConfig

the configuration of the IDP refreshed

requestSender

the ''HttpRequestSender'' to decorate

Attributes

Returns

the behavior of the new actor instance