com.github.kikuomax.spray.jwt

JwtDirectives

trait JwtDirectives extends AnyRef

Provides utilities for building, signing and verification of a JSON Web Token (JWT).

Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. JwtDirectives
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def authorizeToken[T](magnet: JwtAuthorizationMagnet[T]): Directive1[T]

    Verifies a token sent with an HTTP request.

    Verifies a token sent with an HTTP request.

    Thanks to JwtAuthorizationMagnet, this directive works like the following functions,

    authorizeToken[T](verifier: JWTClaimsSet => Option[T])
      (implicit confirmer: JWSObject => Option[JWTClaimsSet]): Directive1[T]
    
    authorizeToken[T](extractor: Directive1[Option[JWSObject]],
                      verifier: JWTClaimsSet => Option[T])
      (implicit confirmer: JWSObject => Option[JWTClaimsSet]): Directive1[T]

    This directive

    1. Extracts a JWS from the request through extractor.
    2. Confirms the signature of the JWS and extracts the claims set by confirmer.
    3. Verifies the claims set by verifier.
    4. Supplies the result from verifier to the inner route.

    Rejects

    • if extractor cannot extract a JWS from the request,
    • or if confirmer cannot confirm the signature of a JWS,
    • or if confirmer cannot extract the claims set from a JWS,
    • or if verifier rejects the claims set.
  8. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  10. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  11. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  13. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  14. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  15. def jwtAuthenticator[T](authenticator: (Option[UserPass]) ⇒ Future[Option[T]])(implicit claimsBuilder: (T) ⇒ Option[JWTClaimsSet], signer: (JWTClaimsSet) ⇒ JWSObject, executionContext: ExecutionContext): (Option[UserPass]) ⇒ Future[Option[JWSObject]]

    UserPassAuthenticator that returns a JWS object if a given pair of a user and a password is authenticated.

    UserPassAuthenticator that returns a JWS object if a given pair of a user and a password is authenticated.

    Useful if combined with BasicAuth and an authenticate directive. An inner route of an authenticate directive will receive a JSON Web Signature object (JWSObject) built by claimsBuilder and signed by signer.

    T

    Outcome type of authenticator.

    authenticator

    Authenticates a given pair of a user and a password.

    claimsBuilder

    Builds a claims set from the authentication result.

    signer

    Signs the claims set and creates a JSON Web Signature.

    executionContext

    Execution context where a Future returned from authenticator runs.

  16. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  17. final def notify(): Unit

    Definition Classes
    AnyRef
  18. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  19. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  20. def toString(): String

    Definition Classes
    AnyRef → Any
  21. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  22. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  23. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped