Package org.keycloak.services.cors
Class DefaultCors
java.lang.Object
org.keycloak.services.cors.DefaultCors
- Author:
- Stian Thorgersen
-
Field Summary
Fields inherited from interface org.keycloak.services.cors.Cors
ACCESS_CONTROL_ALLOW_CREDENTIALS, ACCESS_CONTROL_ALLOW_HEADERS, ACCESS_CONTROL_ALLOW_METHODS, ACCESS_CONTROL_ALLOW_ORIGIN, ACCESS_CONTROL_ALLOW_ORIGIN_WILDCARD, ACCESS_CONTROL_EXPOSE_HEADERS, ACCESS_CONTROL_MAX_AGE, AUTHORIZATION_HEADER, DEFAULT_ALLOW_HEADERS, DEFAULT_ALLOW_METHODS, DEFAULT_MAX_AGE, ORIGIN_HEADER -
Method Summary
Modifier and TypeMethodDescriptionvoidadd()Add the CORS headers to the currentHttpResponse.allowedMethods(String... allowedMethods) auth()builder(jakarta.ws.rs.core.Response.ResponseBuilder builder) checkAllowedOrigins(List<String> allowedOrigins) checkAllowedOrigins(KeycloakSession session, ClientModel client) Sets the allowed origins from the client's configured web origins and checks the incoming Origin header against them.checkAllowedOrigins(AccessToken token) voidclose()exposedHeaders(String... exposedHeaders)
-
Method Details
-
builder
-
preflight
-
auth
-
allowAllOrigins
- Specified by:
allowAllOriginsin interfaceCors
-
checkAllowedOrigins
Description copied from interface:CorsSets the allowed origins from the client's configured web origins and checks the incoming Origin header against them. ThrowsForbiddenException(HTTP 403) on a mismatch so the request stops before any side effects. Preflight and same-origin requests pass through without a check.- Specified by:
checkAllowedOriginsin interfaceCors
-
checkAllowedOrigins
- Specified by:
checkAllowedOriginsin interfaceCors
-
checkAllowedOrigins
- Specified by:
checkAllowedOriginsin interfaceCors
-
allowedMethods
- Specified by:
allowedMethodsin interfaceCors
-
exposedHeaders
- Specified by:
exposedHeadersin interfaceCors
-
add
public void add()Description copied from interface:CorsAdd the CORS headers to the currentHttpResponse. -
close
public void close()
-