Interface JwtDirectives

  • All Known Implementing Classes:
    JwtDirectives$

    public interface JwtDirectives
    JwtDirectives provides utilities to assert and extract claims from a JSON Web Token (JWT).

    For more information about JWTs, see {@link https://jwt.io/} or consult RFC 7519: {@link https://datatracker.ietf.org/doc/html/rfc7519}

    • Method Detail

      • jwt

        Directive<scala.Tuple1<JwtClaims>> jwt()
        Wraps its inner route with support for the JWT mechanism, enabling JWT token validation. JWT token validation is done automatically extracting the token from the Authorization header. If the token is valid, the inner route is executed and provided the set of claims as JwtClaims, otherwise a 401 Unauthorized response is returned.
        Returns:
        (undocumented)
      • jwt

        Directive<scala.Tuple1<JwtClaims>> jwt​(JwtSettings settings)
        Wraps its inner route with support for the JWT mechanism, enabling JWT token validation using the given jwt settings. JWT token validation is done automatically extracting the token from the Authorization header. If the token is valid, the inner route is executed and provided the set of claims as JwtClaims, otherwise a 401 Unauthorized response is returned.
        Parameters:
        settings - (undocumented)
        Returns:
        (undocumented)
      • bearerTokenAuthenticator

        scala.Function1<Credentials,​scala.Option<spray.json.JsObject>> bearerTokenAuthenticator​(JwtSupport jwtSupport,
                                                                                                      akka.event.LoggingAdapter log)