Package org.keycloak.services.cors
Interface Cors
- All Superinterfaces:
Provider
- All Known Implementing Classes:
DefaultCors
- Author:
- Stian Thorgersen
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidadd()Add the CORS headers to the currentHttpResponse.default jakarta.ws.rs.core.Responseadd(jakarta.ws.rs.core.Response.ResponseBuilder builder) Add the CORS headers to the current serverHttpResponseand returns aResponsebased on the givenbuilder.allowedMethods(String... allowedMethods) allowedOrigins(String... allowedOrigins) allowedOrigins(KeycloakSession session, ClientModel client) allowedOrigins(AccessToken token) auth()static Corsbuilder()builder(jakarta.ws.rs.core.Response.ResponseBuilder builder) exposedHeaders(String... exposedHeaders)
-
Field Details
-
DEFAULT_MAX_AGE
static final long DEFAULT_MAX_AGE -
DEFAULT_ALLOW_METHODS
- See Also:
-
DEFAULT_ALLOW_HEADERS
- See Also:
-
ORIGIN_HEADER
- See Also:
-
AUTHORIZATION_HEADER
- See Also:
-
ACCESS_CONTROL_ALLOW_ORIGIN
- See Also:
-
ACCESS_CONTROL_ALLOW_METHODS
- See Also:
-
ACCESS_CONTROL_ALLOW_HEADERS
- See Also:
-
ACCESS_CONTROL_EXPOSE_HEADERS
- See Also:
-
ACCESS_CONTROL_ALLOW_CREDENTIALS
- See Also:
-
ACCESS_CONTROL_MAX_AGE
- See Also:
-
ACCESS_CONTROL_ALLOW_ORIGIN_WILDCARD
- See Also:
-
-
Method Details
-
builder
-
builder
-
preflight
Cors preflight() -
auth
Cors auth() -
allowAllOrigins
Cors allowAllOrigins() -
allowedOrigins
-
allowedOrigins
-
allowedOrigins
-
allowedMethods
-
exposedHeaders
-
add
void add()Add the CORS headers to the currentHttpResponse. -
add
default jakarta.ws.rs.core.Response add(jakarta.ws.rs.core.Response.ResponseBuilder builder) Add the CORS headers to the current server
HttpResponseand returns aResponsebased on the givenbuilder.This is a convenient method to make it easier to return a
Responsefrom methods while at the same time adding the corresponding CORS headers to the underlying server response.- Parameters:
builder- the response builder- Returns:
- the response built from the response builder
-