public final class Okta
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static org.springframework.security.config.annotation.web.builders.HttpSecurity |
configureOAuth2WithPkce(org.springframework.security.config.annotation.web.builders.HttpSecurity http,
org.springframework.security.oauth2.client.registration.ClientRegistrationRepository clientRegistrationRepository)
Configures the
http with an OAuth2 Login, that supports PKCE. |
static org.springframework.security.config.web.server.ServerHttpSecurity |
configureOAuth2WithPkce(org.springframework.security.config.web.server.ServerHttpSecurity http,
org.springframework.security.oauth2.client.registration.ReactiveClientRegistrationRepository clientRegistrationRepository)
Configures the
http with an OAuth2 Login, that supports PKCE. |
static org.springframework.security.config.annotation.web.builders.HttpSecurity |
configureResourceServer401ResponseBody(org.springframework.security.config.annotation.web.builders.HttpSecurity http)
Configures the
http to return a NON-EMPTY response body if the client supports the Media Type text/plain. |
static org.springframework.security.config.web.server.ServerHttpSecurity |
configureResourceServer401ResponseBody(org.springframework.security.config.web.server.ServerHttpSecurity http)
Configures the
http to return a NON-EMPTY response body if the client supports the Media Type text/plain. |
public static org.springframework.security.config.web.server.ServerHttpSecurity configureResourceServer401ResponseBody(org.springframework.security.config.web.server.ServerHttpSecurity http)
http to return a NON-EMPTY response body if the client supports the Media Type text/plain.
This is to work around an issue with Chrome, when a response body is empty, Chrome will show a `This site can’t be reached`, ERR_INVALID_RESPONSE error.
The body content will contain the HTTP Status and simple message such as `401 Unauthorized`.http - the ServerHttpSecurity to configurehttp to allow method chainingpublic static org.springframework.security.config.annotation.web.builders.HttpSecurity configureResourceServer401ResponseBody(org.springframework.security.config.annotation.web.builders.HttpSecurity http)
throws java.lang.Exception
http to return a NON-EMPTY response body if the client supports the Media Type text/plain.
This is to work around an issue with Chrome, when a response body is empty, Chrome will show a `This site can’t be reached`, ERR_INVALID_RESPONSE error.
The body content will contain the HTTP Status and simple message such as `401 Unauthorized`.http - the HttpSecurity to configurehttp to allow method chainingjava.lang.Exceptionpublic static org.springframework.security.config.web.server.ServerHttpSecurity configureOAuth2WithPkce(org.springframework.security.config.web.server.ServerHttpSecurity http,
org.springframework.security.oauth2.client.registration.ReactiveClientRegistrationRepository clientRegistrationRepository)
http with an OAuth2 Login, that supports PKCE. The default Spring Security implementation
only enables PKCE for public clients.
NOTE: Enabling PKCE will be required for all clients (public and confidential) in the future OAuth 2.1 spec.
http - the ServerHttpSecurity to configureclientRegistrationRepository - the repository bean, this should be injected into the calling method.http to allow method chainingpublic static org.springframework.security.config.annotation.web.builders.HttpSecurity configureOAuth2WithPkce(org.springframework.security.config.annotation.web.builders.HttpSecurity http,
org.springframework.security.oauth2.client.registration.ClientRegistrationRepository clientRegistrationRepository)
throws java.lang.Exception
http with an OAuth2 Login, that supports PKCE. The default Spring Security implementation
only enables PKCE for public clients.
NOTE: Enabling PKCE will be required for all clients (public and confidential) in the future OAuth 2.1 spec.
http - the HttpSecurity to configureclientRegistrationRepository - the repository bean, this should be injected into the calling method.http to allow method chainingjava.lang.ExceptionCopyright © 2017-2022 Okta. All Rights Reserved.