Class Okta


  • public final class Okta
    extends Object
    Okta + Spring Security utility methods.
    Since:
    1.2.0
    • Method Detail

      • configureResourceServer401ResponseBody

        public 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. 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`.
        Parameters:
        http - the ServerHttpSecurity to configure
        Returns:
        the http to allow method chaining
      • configureResourceServer401ResponseBody

        public static org.springframework.security.config.annotation.web.builders.HttpSecurity configureResourceServer401ResponseBody​(org.springframework.security.config.annotation.web.builders.HttpSecurity http)
                                                                                                                               throws Exception
        Configures the 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`.
        Parameters:
        http - the HttpSecurity to configure
        Returns:
        the http to allow method chaining
        Throws:
        Exception