class RedoxTokenManager extends RedoxClientComponents

Redox uses a perishable accessToken with an expiry to authenticate requests. The accessToken is obtained by exchanging a apiKey and an apiSecret. On the first exchange we receive:

  1. accessToken 2. expiry time 3. refreshToken

We use the RefreshToken obtained from the first request to obtain new accessTokens as they expire.

The RedoxTokenManager schedules the refresh and storage of accessTokens and keeps them valid, so a client doesn't have to authenticate each time it makes a request.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. RedoxTokenManager
  2. RedoxClientComponents
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new RedoxTokenManager(client: HttpClient, baseRestUri: Uri)(implicit actorSystem: ActorSystem, materializer: Materializer)

    client

    com.github.vitalsoftware.scalaredox.client.HttpClient instance

    baseRestUri

    the base url for Redox REST endpoint.

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def authenticate(apiKey: String, apiSecret: String): Future[AuthInfo]

    Authorize to Redox, returning a Future containing the access and refresh tokens.

    Authorize to Redox, returning a Future containing the access and refresh tokens.

    Attributes
    protected
  6. def basePost: Self
    Attributes
    protected
    Definition Classes
    RedoxClientComponents
  7. def baseQuery: Self
    Attributes
    protected
    Definition Classes
    RedoxClientComponents
  8. def baseRequest(url: String): StandaloneWSRequest
    Attributes
    protected
    Definition Classes
    RedoxClientComponents
  9. def baseUpload: Self
    Attributes
    protected
    Definition Classes
    RedoxClientComponents
  10. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  11. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  12. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  13. def execute[T](request: StandaloneWSRequest)(implicit format: Reads[T]): Future[RedoxResponse[T]]

    Raw request execution

    Raw request execution

    Attributes
    protected
    Definition Classes
    RedoxClientComponents
  14. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  15. def getAccessToken(apiKey: String, apiSecret: String): Future[AuthInfo]

    Returns an access token for given credentials.

    Returns an access token for given credentials. If the access token doesn't exist, authorize with Redox to obtain a new access token.

  16. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  17. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  18. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  19. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  20. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  21. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  22. def refresh(apiKey: String, auth: AuthInfo): Future[AuthInfo]

    Refresh the access and refresh tokens.

    Refresh the access and refresh tokens.

    Attributes
    protected
  23. def scheduleRefresh(apiKey: String, auth: AuthInfo): Unit

    Refresh the auth token a minute before it expires.

    Refresh the auth token a minute before it expires. Set and schedule a new refresh to occur. NOTE: If this method is overridden, scheduling and storing the new auth token will not be available to the implementing class.

    Attributes
    protected
  24. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  25. def toString(): String
    Definition Classes
    AnyRef → Any
  26. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  27. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  28. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )

Inherited from RedoxClientComponents

Inherited from AnyRef

Inherited from Any

Ungrouped