public class JwtWebSecurityConfigurer extends 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(String audience,
String issuer,
org.springframework.security.authentication.AuthenticationProvider provider)
Configures application authorization for JWT signed with HS256
|
static JwtWebSecurityConfigurer |
forHS256(String audience,
String issuer,
byte[] secret)
Configures application authorization for JWT signed with HS256
|
static JwtWebSecurityConfigurer |
forHS256WithBase64Secret(String audience,
String issuer,
String secret)
Configures application authorization for JWT signed with HS256
|
static JwtWebSecurityConfigurer |
forRS256(String audience,
String issuer)
Configures application authorization for JWT signed with RS256.
|
static JwtWebSecurityConfigurer |
forRS256(String audience,
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(String audience, 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(String audience, 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(String audience, String issuer, 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(String audience, 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(String audience, 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 Exception
HttpSecurity object with some sensible defaults
by registering objects to obtain a bearer token from a request.http - configuration for SpringException - _Copyright © 2019. All rights reserved.