Interface JavaScriptRequestChecker


  • public interface JavaScriptRequestChecker
    JavaScriptRequestChecker can be used to check if the current request was made by JavaScript running inside Single-page application (SPA).

    Some OpenId Connect providers may not support CORS in their authorization endpoints. In such cases, SPA needs to avoid using JavaScript for running authorization code flow redirects and instead delegate it to the browser.

    If this checker confirms it is a JavaScript request and if authentication challenge redirects are also disabled with 'quarkus.oidc.authentication.java-script-auto-redirect=false' then an HTTP error status `499` will be reported allowing SPA to intercept this error and repeat the last request causing the challenge with the browser API.

    • Method Detail

      • isJavaScriptRequest

        boolean isJavaScriptRequest​(io.vertx.ext.web.RoutingContext context)
        Check if the current request was made by JavaScript
        Parameters:
        context - RoutingContext
        Returns:
        true if the current request was made by JavaScript