Package org.keycloak.services.cors
Interface Cors
- All Superinterfaces:
Provider
- All Known Implementing Classes:
DefaultCors
- Author:
- Stian Thorgersen
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
add()
Add the CORS headers to the currentHttpResponse
.default jakarta.ws.rs.core.Response
add
(jakarta.ws.rs.core.Response.ResponseBuilder builder) Add the CORS headers to the current serverHttpResponse
and returns aResponse
based on the givenbuilder
.allowedMethods
(String... allowedMethods) allowedOrigins
(String... allowedOrigins) allowedOrigins
(KeycloakSession session, ClientModel client) allowedOrigins
(AccessToken token) auth()
static Cors
builder()
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
HttpResponse
and returns aResponse
based on the givenbuilder
.This is a convenient method to make it easier to return a
Response
from 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
-