Package org.keycloak.services.resources
Class Cors
- java.lang.Object
-
- org.keycloak.services.resources.Cors
-
public class Cors extends Object
- Author:
- Stian Thorgersen
-
-
Field Summary
Fields Modifier and Type Field Description static String
ACCESS_CONTROL_ALLOW_CREDENTIALS
static String
ACCESS_CONTROL_ALLOW_HEADERS
static String
ACCESS_CONTROL_ALLOW_METHODS
static String
ACCESS_CONTROL_ALLOW_ORIGIN
static String
ACCESS_CONTROL_ALLOW_ORIGIN_WILDCARD
static String
ACCESS_CONTROL_EXPOSE_HEADERS
static String
ACCESS_CONTROL_MAX_AGE
static String
AUTHORIZATION_HEADER
static String
DEFAULT_ALLOW_HEADERS
static String
DEFAULT_ALLOW_METHODS
static long
DEFAULT_MAX_AGE
static String
INCLUDE_REDIRECTS
static String
ORIGIN_HEADER
-
Constructor Summary
Constructors Constructor Description Cors(HttpRequest request)
Cors(HttpRequest request, javax.ws.rs.core.Response.ResponseBuilder response)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Cors
add(HttpRequest request)
static Cors
add(HttpRequest request, javax.ws.rs.core.Response.ResponseBuilder response)
Cors
allowAllOrigins()
Cors
allowedMethods(String... allowedMethods)
Cors
allowedOrigins(String... allowedOrigins)
Cors
allowedOrigins(KeycloakSession session, ClientModel client)
Cors
allowedOrigins(AccessToken token)
Cors
auth()
javax.ws.rs.core.Response
build()
void
build(BiConsumer<String,String> addHeader)
void
build(HttpResponse response)
Cors
builder(javax.ws.rs.core.Response.ResponseBuilder builder)
Cors
exposedHeaders(String... exposedHeaders)
Cors
preflight()
-
-
-
Field Detail
-
DEFAULT_MAX_AGE
public static final long DEFAULT_MAX_AGE
-
DEFAULT_ALLOW_METHODS
public static final String DEFAULT_ALLOW_METHODS
- See Also:
- Constant Field Values
-
DEFAULT_ALLOW_HEADERS
public static final String DEFAULT_ALLOW_HEADERS
- See Also:
- Constant Field Values
-
ORIGIN_HEADER
public static final String ORIGIN_HEADER
- See Also:
- Constant Field Values
-
AUTHORIZATION_HEADER
public static final String AUTHORIZATION_HEADER
- See Also:
- Constant Field Values
-
ACCESS_CONTROL_ALLOW_ORIGIN
public static final String ACCESS_CONTROL_ALLOW_ORIGIN
- See Also:
- Constant Field Values
-
ACCESS_CONTROL_ALLOW_METHODS
public static final String ACCESS_CONTROL_ALLOW_METHODS
- See Also:
- Constant Field Values
-
ACCESS_CONTROL_ALLOW_HEADERS
public static final String ACCESS_CONTROL_ALLOW_HEADERS
- See Also:
- Constant Field Values
-
ACCESS_CONTROL_EXPOSE_HEADERS
public static final String ACCESS_CONTROL_EXPOSE_HEADERS
- See Also:
- Constant Field Values
-
ACCESS_CONTROL_ALLOW_CREDENTIALS
public static final String ACCESS_CONTROL_ALLOW_CREDENTIALS
- See Also:
- Constant Field Values
-
ACCESS_CONTROL_MAX_AGE
public static final String ACCESS_CONTROL_MAX_AGE
- See Also:
- Constant Field Values
-
ACCESS_CONTROL_ALLOW_ORIGIN_WILDCARD
public static final String ACCESS_CONTROL_ALLOW_ORIGIN_WILDCARD
- See Also:
- Constant Field Values
-
INCLUDE_REDIRECTS
public static final String INCLUDE_REDIRECTS
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Cors
public Cors(HttpRequest request, javax.ws.rs.core.Response.ResponseBuilder response)
-
Cors
public Cors(HttpRequest request)
-
-
Method Detail
-
add
public static Cors add(HttpRequest request, javax.ws.rs.core.Response.ResponseBuilder response)
-
add
public static Cors add(HttpRequest request)
-
builder
public Cors builder(javax.ws.rs.core.Response.ResponseBuilder builder)
-
preflight
public Cors preflight()
-
auth
public Cors auth()
-
allowAllOrigins
public Cors allowAllOrigins()
-
allowedOrigins
public Cors allowedOrigins(KeycloakSession session, ClientModel client)
-
allowedOrigins
public Cors allowedOrigins(AccessToken token)
-
build
public javax.ws.rs.core.Response build()
-
build
public void build(HttpResponse response)
-
build
public void build(BiConsumer<String,String> addHeader)
-
-