Class JwtDirectives
- java.lang.Object
-
- akka.http.jwt.javadsl.server.directives.JwtDirectives
-
public abstract class JwtDirectives extends java.lang.Object
JwtDirectives provides utilities to easily 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}
-
-
Constructor Summary
Constructors Constructor Description JwtDirectives()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Route
jwt(JwtSettings settings, java.util.function.Function<JwtClaims,Route> inner)
Wraps its inner route with support for the JWT mechanism, enabling JWT token validation using the given jwt settings.Route
jwt(java.util.function.Function<JwtClaims,Route> inner)
Wraps its inner route with support for the JWT mechanism, enabling JWT token validation.
-
-
-
Method Detail
-
jwt
public Route jwt(java.util.function.Function<JwtClaims,Route> inner)
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 asJwtClaims
, otherwise a 401 Unauthorized response is returned.- Parameters:
inner
- (undocumented)- Returns:
- (undocumented)
-
jwt
public Route jwt(JwtSettings settings, java.util.function.Function<JwtClaims,Route> inner)
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 asJwtClaims
, otherwise a 401 Unauthorized response is returned.- Parameters:
settings
- (undocumented)inner
- (undocumented)- Returns:
- (undocumented)
-
-