-
Bug
-
Resolution: Unresolved
-
Optional
-
None
-
None
-
None
Currently org.wildfly.security.http.bearer.BearerTokenAuthenticationMechanism does not support reading the jwt token from cookies. Is it possible to add (maybe as a fallback?) in case there doesn't exist an authorization header?
@Override public void evaluateRequest(HttpServerRequest request) throws HttpAuthenticationException { // Read token from authorization header List<String> authorizationValues = request.getRequestHeaderValues(HttpConstants.AUTHORIZATION); // Fallback: read token from cookies, if no authorization-header present if (authorizationValues == null || authorizationValues.isEmpty()) { List<HttpServerCookie> cookies = request.getCookies(); // Cookie handling if (cookies != null) { for (HttpServerCookie cookie : cookies) { if (HttpConstants.AUTHORIZATION.equals(cookie.getName())) { authorizationValues = Collections.singletonList("Bearer " + cookie.getValue()); break; } } } }
Thanks.