public class JwtWebSecurityConfigurer
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
org.springframework.security.config.annotation.web.builders.HttpSecurity |
configure(org.springframework.security.config.annotation.web.builders.HttpSecurity http)
Further configure the
HttpSecurity object with some sensible defaults
by registering objects to obtain a bearer token from a request. |
static JwtWebSecurityConfigurer |
forHS256(java.lang.String audience,
java.lang.String issuer,
org.springframework.security.authentication.AuthenticationProvider provider)
Configures application authorization for JWT signed with HS256
|
static JwtWebSecurityConfigurer |
forHS256(java.lang.String audience,
java.lang.String issuer,
byte[] secret)
Configures application authorization for JWT signed with HS256
|
static JwtWebSecurityConfigurer |
forHS256WithBase64Secret(java.lang.String audience,
java.lang.String issuer,
java.lang.String secret)
Configures application authorization for JWT signed with HS256
|
static JwtWebSecurityConfigurer |
forRS256(java.lang.String audience,
java.lang.String issuer)
Configures application authorization for JWT signed with RS256.
|
static JwtWebSecurityConfigurer |
forRS256(java.lang.String audience,
java.lang.String issuer,
org.springframework.security.authentication.AuthenticationProvider provider)
Configures application authorization for JWT signed with RS256
Will try to validate the token using the public key downloaded from "$issuer/.well-known/jwks.json"
and matched by the value of
kid of the JWT header |
public static JwtWebSecurityConfigurer forRS256(java.lang.String audience, java.lang.String issuer)
kid of the JWT headeraudience - identifier of the API and must match the aud value in the tokenissuer - of the token for this API and must match the iss value in the tokenpublic static JwtWebSecurityConfigurer forRS256(java.lang.String audience, java.lang.String issuer, org.springframework.security.authentication.AuthenticationProvider provider)
kid of the JWT headeraudience - identifier of the API and must match the aud value in the tokenissuer - of the token for this API and must match the iss value in the tokenprovider - of Spring Authentication objects that can validate a PreAuthenticatedAuthenticationJsonWebTokenpublic static JwtWebSecurityConfigurer forHS256WithBase64Secret(java.lang.String audience, java.lang.String issuer, java.lang.String secret)
audience - identifier of the API and must match the aud value in the tokenissuer - of the token for this API and must match the iss value in the tokensecret - used to sign and verify tokens encoded in Base64public static JwtWebSecurityConfigurer forHS256(java.lang.String audience, java.lang.String issuer, byte[] secret)
audience - identifier of the API and must match the aud value in the tokenissuer - of the token for this API and must match the iss value in the tokensecret - used to sign and verify tokenspublic static JwtWebSecurityConfigurer forHS256(java.lang.String audience, java.lang.String issuer, org.springframework.security.authentication.AuthenticationProvider provider)
audience - identifier of the API and must match the aud value in the tokenissuer - of the token for this API and must match the iss value in the tokenprovider - of Spring Authentication objects that can validate a PreAuthenticatedAuthenticationJsonWebTokenpublic org.springframework.security.config.annotation.web.builders.HttpSecurity configure(org.springframework.security.config.annotation.web.builders.HttpSecurity http)
throws java.lang.Exception
HttpSecurity object with some sensible defaults
by registering objects to obtain a bearer token from a request.http - configuration for Springjava.lang.Exception