使用OpenID Connect(OIDC)多租户
This guide demonstrates how your OpenID Connect (OIDC) application can support multi-tenancy so that you can serve multiple tenants from a single application. Tenants can be distinct realms or security domains within the same OpenID Provider or even distinct OpenID Providers.
When serving multiple customers from the same application (e.g.: SaaS), each customer is a tenant. By enabling multi-tenancy support to your applications you are allowed to also support distinct authentication policies for each tenant even though if that means authenticating against different OpenID Providers, such as Keycloak and Google.
Please read the Using OpenID Connect to Protect Service Applications guide if you need to authorize a tenant using Bearer Token Authorization.
Please read the Using OpenID Connect to Protect Web Applications guide if you need to authenticate and authorize a tenant using OpenID Connect Authorization Code Flow.
先决条件
要完成这个指南,你需要:
-
大概15分钟
-
编辑器
-
安装JDK 11以上版本并正确配置了
JAVA_HOME -
Apache Maven 3.8.6
-
A working container runtime (Docker or Podman)
-
如果你愿意的话,还可以选择使用Quarkus CLI
-
如果你想构建原生可执行程序,可以选择安装Mandrel或者GraalVM,并正确配置(或者使用Docker在容器中进行构建)
应用结构
In this example, we build a very simple application which supports two resource methods:
-
/{tenant}
This resource returns information obtained from the ID token issued by OpenID Provider about the authenticated user and the current tenant.
-
/{tenant}/bearer
This resource returns information obtained from the Access token issued by OpenID Provider about the authenticated user and the current tenant.
解决方案
我们建议您按照下一节的说明逐步创建应用程序。然而,您可以直接转到已完成的示例。
克隆 Git 仓库: git clone https://github.com/quarkusio/quarkus-quickstarts.git ,或下载一个 存档 。
The solution is located in the security-openid-connect-multi-tenancy-quickstart directory.
创建Maven项目
首先,我们需要一个新的项目。使用以下命令创建一个新的项目:
如果你已经配置了你的Quarkus项目,你可以通过在你的项目基础目录下运行以下命令,将 oidc 扩展加入到你的项目中去:
quarkus extension add 'oidc'
./mvnw quarkus:add-extension -Dextensions='oidc'
./gradlew addExtension --extensions='oidc'
这将在您的构建文件中添加以下内容:
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-oidc</artifactId>
</dependency>
implementation("io.quarkus:quarkus-oidc")
编写应用程序
Let’s start by implementing the /{tenant} endpoint. As you can see from the source code below it is just a regular JAX-RS resource:
package org.acme.quickstart.oidc;
import javax.inject.Inject;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import org.eclipse.microprofile.jwt.JsonWebToken;
import io.quarkus.oidc.IdToken;
@Path("/{tenant}")
public class HomeResource {
/**
* Injection point for the ID Token issued by the OpenID Connect Provider
*/
@Inject
@IdToken
JsonWebToken idToken;
/**
* Injection point for the Access Token issued by the OpenID Connect Provider
*/
@Inject
JsonWebToken accessToken;
/**
* Returns the ID Token info. This endpoint exists only for demonstration purposes, you should not
* expose this token in a real application.
*
* @return ID Token info
*/
@GET
@Produces("text/html")
public String getIdTokenInfo() {
StringBuilder response = new StringBuilder().append("<html>")
.append("<body>");
response.append("<h2>Welcome, ").append(this.idToken.getClaim("email").toString()).append("</h2>\n");
response.append("<h3>You are accessing the application within tenant <b>").append(idToken.getIssuer()).append(" boundaries</b></h3>");
return response.append("</body>").append("</html>").toString();
}
/**
* Returns the Access Token info. This endpoint exists only for demonstration purposes, you should not
* expose this token in a real application.
*
* @return Access Token info
*/
@GET
@Produces("text/html")
@Path("bearer")
public String getAccessTokenInfo() {
StringBuilder response = new StringBuilder().append("<html>")
.append("<body>");
response.append("<h2>Welcome, ").append(this.accessToken.getClaim("email").toString()).append("</h2>\n");
response.append("<h3>You are accessing the application within tenant <b>").append(accessToken.getIssuer()).append(" boundaries</b></h3>");
return response.append("</body>").append("</html>").toString();
}
}
In order to resolve the tenant from incoming requests and map it to a specific quarkus-oidc tenant configuration in application.properties, you need to create an implementation for the io.quarkus.oidc.TenantConfigResolver interface which can be used to resolve the tenant configurations dynamically:
package org.acme.quickstart.oidc;
import javax.enterprise.context.ApplicationScoped;
import org.eclipse.microprofile.config.ConfigProvider;
import io.quarkus.oidc.OidcRequestContext;
import io.quarkus.oidc.OidcTenantConfig;
import io.quarkus.oidc.OidcTenantConfig.ApplicationType;
import io.quarkus.oidc.TenantConfigResolver;
import io.smallrye.mutiny.Uni;
import io.vertx.ext.web.RoutingContext;
@ApplicationScoped
public class CustomTenantResolver implements TenantConfigResolver {
@Override
public Uni<OidcTenantConfig> resolve(RoutingContext context, OidcRequestContext<OidcTenantConfig> requestContext) {
String path = context.request().path();
if (path.startsWith("/tenant-a")) {
String keycloakUrl = ConfigProvider.getConfig().getValue("keycloak.url", String.class);
OidcTenantConfig config = new OidcTenantConfig();
config.setTenantId("tenant-a");
config.setAuthServerUrl(keycloakUrl + "/realms/tenant-a");
config.setClientId("multi-tenant-client");
config.getCredentials().setSecret("secret");
config.setApplicationType(ApplicationType.HYBRID);
return Uni.createFrom().item(config);
} else {
// resolve to default tenant config
return Uni.createFrom().nullItem();
}
}
}
From the implementation above, tenants are resolved from the request path so that in case no tenant could be inferred, null is returned to indicate that the default tenant configuration should be used.
Note the tenant-a application type is hybrid - it can accept HTTP bearer tokens if provided, otherwise it will initiate an authorization code flow when the authentication is required.
配置该应用程序
# Default Tenant Configuration
%prod.quarkus.oidc.auth-server-url=http://localhost:8180/realms/quarkus
quarkus.oidc.client-id=multi-tenant-client
quarkus.oidc.application-type=web-app
# Tenant A Configuration is created dynamically in CustomTenantConfigResolver
# HTTP Security Configuration
quarkus.http.auth.permission.authenticated.paths=/*
quarkus.http.auth.permission.authenticated.policy=authenticated
The first configuration is the default tenant configuration that should be used when the tenant can not be inferred from the request. Note that a %prod profile prefix is used with quarkus.oidc.auth-server-url - it is done to support testing a multi-tenant application with Dev Services For Keycloak. This configuration is using a Keycloak instance to authenticate users.
The second configuration is provided by TenantConfigResolver, it is the configuration that will be used when an incoming request is mapped to the tenant tenant-a.
Note that both configurations map to the same Keycloak server instance while using distinct realms.
Alternatively you can configure the tenant tenant-a directly in application.properties:
# Default Tenant Configuration
%prod.quarkus.oidc.auth-server-url=http://localhost:8180/realms/quarkus
quarkus.oidc.client-id=multi-tenant-client
quarkus.oidc.application-type=web-app
# Tenant A Configuration
quarkus.oidc.tenant-a.auth-server-url=http://localhost:8180/realms/tenant-a
quarkus.oidc.tenant-a.client-id=multi-tenant-client
quarkus.oidc.tenant-a.application-type=web-app
# HTTP Security Configuration
quarkus.http.auth.permission.authenticated.paths=/*
quarkus.http.auth.permission.authenticated.policy=authenticated
and use a custom TenantConfigResolver to resolve it:
package org.acme.quickstart.oidc;
import javax.enterprise.context.ApplicationScoped;
import io.quarkus.oidc.TenantResolver;
import io.vertx.ext.web.RoutingContext;
@ApplicationScoped
public class CustomTenantResolver implements TenantResolver {
@Override
public String resolve(RoutingContext context) {
String path = context.request().path();
String[] parts = path.split("/");
if (parts.length == 0) {
// resolve to default tenant configuration
return null;
}
return parts[1];
}
}
You can define multiple tenants in your configuration file, just make sure they have a unique alias so that you can map them properly when resolving a tenant from your TenantResolver implementation.
However, using a static tenant resolution (configuring tenants in application.properties and resolving them with TenantResolver) prevents testing the endpoint with Dev Services for Keycloak since Dev Services for Keycloak has no knowledge of how the requests will be mapped to individual tenants and can not dynamically provide tenant-specific quarkus.oidc.<tenant-id>.auth-server-url values and therefore using %prod prefixes with the tenant-specific URLs in application.properties will not work in tests or devmode.
|
When a current tenant represents an OIDC
A similar technique can be used with |
|
If you also use Hibernate ORM multitenancy and both OIDC and Hibernate ORM tenant IDs are the same and must be extracted from the Vert.x
|
启动和配置Keycloak服务器
要启动Keycloak服务器,您可以使用Docker服务,且只需运行以下命令:
docker run --name keycloak -e KEYCLOAK_ADMIN=admin -e KEYCLOAK_ADMIN_PASSWORD=admin -p 8180:8080 quay.io/keycloak/keycloak:{keycloak.version} start-dev
其中 keycloak.version 应该设置为 17.0.0 或更高。
你应该能够通过 localhost:8180 访问你的Keycloak服务器。
以 admin 用户身份登录,访问Keycloak管理控制台。用户名应该是 admin ,密码是 admin 。
Now, follow the steps below to import the realms for the two tenants:
-
Import the default-tenant-realm.json to create the default realm
-
Import the tenant-a-realm.json to create the realm for the tenant
tenant-a.
For more details, see the Keycloak documentation about how to create a new realm.
Running and Using the Application
Running in Developer Mode
To run the microservice in dev mode, use:
quarkus dev
./mvnw quarkus:dev
./gradlew --console=plain quarkusDev
Running in JVM Mode
When you’re done playing with dev mode, you can run it as a standard Java application.
首先编译它:
quarkus build
./mvnw install
./gradlew build
然后运行:
java -jar target/quarkus-app/quarkus-run.jar
Running in Native Mode
这个同样的演示可以被编译成本地代码:不需要任何修改。
这意味着您不再需要在您的生产环境中安装JVM,因为运行时技术包含在生产的二进制文件中,并以最小的资源开销优化运行。
Compilation will take a bit longer, so this step is disabled by default; let’s build again by enabling the native build:
quarkus build --native
./mvnw install -Dnative
./gradlew build -Dquarkus.package.type=native
一杯咖啡的时间后,您就可以直接运行该二进制文件了:
./target/security-openid-connect-multi-tenancy-quickstart-runner
Test the Application
Use Dev Services for Keycloak
Using Dev Services for Keycloak is recommended for the integration testing against Keycloak.
Dev Services for Keycloak will launch and initialize a test container: it will import configured realms and set a base Keycloak URL for CustomTenantResolver used in this quickstart to calculate a realm specific URL.
First you need to add the following dependencies:
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-test-keycloak-server</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.sourceforge.htmlunit</groupId>
<artifactId>htmlunit</artifactId>
<scope>test</scope>
</dependency>
testImplementation("io.quarkus:quarkus-test-keycloak-server")
testImplementation("io.rest-assured:rest-assured")
testImplementation("net.sourceforge.htmlunit:htmlunit")
quarkus-test-keycloak-server provides a utility class io.quarkus.test.keycloak.client.KeycloakTestClient for acquiring the realm specific access tokens and which you can use with RestAssured for testing the /{tenant}/bearer endpoint expecting bearer access tokens.
HtmlUnit is used for testing the /{tenant} endpoint and the authorization code flow.
Next, configure the required realms:
# Default Tenant Configuration
%prod.quarkus.oidc.auth-server-url=http://localhost:8180/realms/quarkus
quarkus.oidc.client-id=multi-tenant-client
quarkus.oidc.application-type=web-app
# Tenant A Configuration is created dynamically in CustomTenantConfigResolver
# HTTP Security Configuration
quarkus.http.auth.permission.authenticated.paths=/*
quarkus.http.auth.permission.authenticated.policy=authenticated
quarkus.keycloak.devservices.realm-path=default-tenant-realm.json,tenant-a-realm.json
最后编写你的测试,它将在JVM模式下执行:
package org.acme.quickstart.oidc;
import static org.hamcrest.Matchers.containsString;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.io.IOException;
import org.junit.jupiter.api.Test;
import com.gargoylesoftware.htmlunit.SilentCssErrorHandler;
import com.gargoylesoftware.htmlunit.WebClient;
import com.gargoylesoftware.htmlunit.html.HtmlForm;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
import io.quarkus.test.junit.QuarkusTest;
import io.quarkus.test.keycloak.client.KeycloakTestClient;
import io.restassured.RestAssured;
@QuarkusTest
public class CodeFlowTest {
KeycloakTestClient keycloakClient = new KeycloakTestClient();
@Test
public void testLogInDefaultTenant() throws IOException {
try (final WebClient webClient = createWebClient()) {
HtmlPage page = webClient.getPage("http://localhost:8081/default");
assertEquals("Sign in to quarkus", page.getTitleText());
HtmlForm loginForm = page.getForms().get(0);
loginForm.getInputByName("username").setValueAttribute("alice");
loginForm.getInputByName("password").setValueAttribute("alice");
page = loginForm.getInputByName("login").click();
assertTrue(page.asText().contains("tenant"));
}
}
@Test
public void testLogInTenantAWebApp() throws IOException {
try (final WebClient webClient = createWebClient()) {
HtmlPage page = webClient.getPage("http://localhost:8081/tenant-a");
assertEquals("Sign in to tenant-a", page.getTitleText());
HtmlForm loginForm = page.getForms().get(0);
loginForm.getInputByName("username").setValueAttribute("alice");
loginForm.getInputByName("password").setValueAttribute("alice");
page = loginForm.getInputByName("login").click();
assertTrue(page.asText().contains("alice@tenant-a.org"));
}
}
@Test
public void testLogInTenantABearerToken() throws IOException {
RestAssured.given().auth().oauth2(getAccessToken()).when()
.get("/tenant-a/bearer").then().body(containsString("alice@tenant-a.org"));
}
private String getAccessToken() {
return keycloakClient.getRealmAccessToken("tenant-a", "alice", "alice", "multi-tenant-client", "secret");
}
private WebClient createWebClient() {
WebClient webClient = new WebClient();
webClient.setCssErrorHandler(new SilentCssErrorHandler());
return webClient;
}
}
在原生模式(native mode)下:
package org.acme.quickstart.oidc;
import io.quarkus.test.junit.QuarkusIntegrationTest;
@QuarkusIntegrationTest
public class CodeFlowIT extends CodeFlowTest {
}
请参阅 Keycloak开发服务 ,来了解更多关于它的初始化和配置方式的信息。
Use Browser
To test the application, you should open your browser and access the following URL:
If everything is working as expected, you should be redirected to the Keycloak server to authenticate. Note that the requested path
defines a default tenant which we don’t have mapped in the configuration file. In this case, the default configuration will be used.
In order to authenticate to the application you should type the following credentials when at the Keycloak login page:
-
Username: alice
-
Password: alice
After clicking the Login button you should be redirected back to the application.
If you try now to access the application at the following URL:
You should be redirected again to the login page at Keycloak. However, now you are going to authenticate using a different realm.
In both cases, if the user is successfully authenticated, the landing page will show the user’s name and e-mail. Even though
user alice exists in both tenants, for the application they are distinct users belonging to different realms/tenants.
Resolving Tenant Identifiers with Annotations
You can use the annotations and CDI interceptors for resolving the tenant identifiers as an alternative to using
quarkus.oidc.TenantResolver. This can be done by setting the value for the key OidcUtils.TENANT_ID_ATTRIBUTE on
the current RoutingContext.
Assuming your application supports two OIDC tenants (hr, and default) first you need to define one
annotation per tenant ID other than default:
|
Proactive HTTP authentication needs to be disabled ( |
@Inherited
@InterceptorBinding
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD, ElementType.TYPE})
public @interface HrTenant {
}
Next, you’ll need one interceptor for each of those annotations:
@Interceptor
@HrTenant
public class HrTenantInterceptor {
@Inject
RoutingContext routingContext;
@AroundInvoke
Object setTenant(InvocationContext context) throws Exception {
routingContext.put(OidcUtils.TENANT_ID_ATTRIBUTE, "hr");
return context.proceed();
}
}
Now all methods and classes carrying @HrTenant will be authenticated using the OIDC provider configured by
quarkus.oidc.hr.auth-server-url, while all other classes and methods will still be authenticated using the default
OIDC provider.
Programmatically Resolving Tenants Configuration
If you need a more dynamic configuration for the different tenants you want to support and don’t want to end up with multiple
entries in your configuration file, you can use the io.quarkus.oidc.TenantConfigResolver.
This interface allows you to dynamically create tenant configurations at runtime:
package io.quarkus.it.keycloak;
import javax.enterprise.context.ApplicationScoped;
import java.util.function.Supplier;
import io.smallrye.mutiny.Uni;
import io.quarkus.oidc.OidcTenantConfig;
import io.quarkus.oidc.TenantConfigResolver;
import io.vertx.ext.web.RoutingContext;
@ApplicationScoped
public class CustomTenantConfigResolver implements TenantConfigResolver {
@Override
public Uni<OidcTenantConfig> resolve(RoutingContext context, TenantConfigResolver.TenantConfigRequestContext requestContext) {
String path = context.request().path();
String[] parts = path.split("/");
if (parts.length == 0) {
// resolve to default tenant configuration
return null;
}
if ("tenant-c".equals(parts[1])) {
// Do 'return requestContext.runBlocking(createTenantConfig());'
// if a blocking call is required to create a tenant config
return Uni.createFromItem(createTenantConfig());
}
// resolve to default tenant configuration
return null;
}
private Supplier<OidcTenantConfig> createTenantConfig() {
final OidcTenantConfig config = new OidcTenantConfig();
config.setTenantId("tenant-c");
config.setAuthServerUrl("http://localhost:8180/realms/tenant-c");
config.setClientId("multi-tenant-client");
OidcTenantConfig.Credentials credentials = new OidcTenantConfig.Credentials();
credentials.setSecret("my-secret");
config.setCredentials(credentials);
// any other setting support by the quarkus-oidc extension
return () -> config;
}
}
The OidcTenantConfig returned from this method is the same used to parse the oidc namespace configuration from the application.properties. You can populate it using any of the settings supported by the quarkus-oidc extension.
Tenant Resolution for OIDC 'web-app' applications
Several options are available for selecting the tenant configuration which should be used to secure the current HTTP request for both service and web-app OIDC applications, such as:
-
Check URL paths, for example, a
tenant-serviceconfiguration has to be used for the "/service" paths, while atenant-manageconfiguration - for the "/management" paths -
Check HTTP headers, for example, with a URL path always being '/service', a header such as "Realm: service" or "Realm: management" can help to select between the
tenant-serviceandtenant-manageconfigurations -
Check URL query parameters - it can work similarly to the way the headers are used to select the tenant configuration
All these options can be easily implemented with the custom TenantResolver and TenantConfigResolver implementations for the OIDC service applications.
However, due to an HTTP redirect required to complete the code authentication flow for the OIDC web-app applications, a custom HTTP cookie may be needed to select the same tenant configuration before and after this redirect request because:
-
URL path may not be the same after the redirect request if a single redirect URL has been registered in the OIDC Provider - the original request path can be restored but after the tenant configuration is resolved
-
HTTP headers used during the original request are not available after the redirect
-
Custom URL query parameters are restored after the redirect but after the tenant configuration is resolved
One option to ensure the information for resolving the tenant configurations for web-app applications is available before and after the redirect is to use a cookie, for example:
package org.acme.quickstart.oidc;
import java.util.List;
import javax.enterprise.context.ApplicationScoped;
import io.quarkus.oidc.TenantResolver;
import io.vertx.core.http.Cookie;
import io.vertx.ext.web.RoutingContext;
@ApplicationScoped
public class CustomTenantResolver implements TenantResolver {
@Override
public String resolve(RoutingContext context) {
List<String> tenantIdQuery = context.queryParam("tenantId");
if (!tenantIdQuery.isEmpty()) {
String tenantId = tenantIdQuery.get(0);
context.addCookie(Cookie.cookie("tenant", tenantId));
return tenantId;
} else if (context.cookieMap().containsKey("tenant")) {
return context.getCookie("tenant").getValue();
}
return null;
}
}
Disabling Tenant Configurations
Custom TenantResolver and TenantConfigResolver implementations may return null if no tenant can be inferred from the current request and a fallback to the default tenant configuration is required.
If it is expected that the custom resolvers will always infer a tenant then the default tenant configuration is not needed. One can disable it with the quarkus.oidc.tenant-enabled=false setting.
Note that tenant specific configurations can also be disabled, for example: quarkus.oidc.tenant-a.tenant-enabled=false.
配置参考
Configuration property fixed at build time - All other configuration properties are overridable at runtime
类型 |
默认 |
|
|---|---|---|
If DevServices has been explicitly enabled or disabled. When DevServices is enabled Quarkus will attempt to automatically configure and start Keycloak when running in Dev or Test mode and when Docker is running. Environment variable: Show more |
boolean |
|
The container image name to use, for container based DevServices providers. Image with a Quarkus based distribution is used by default. Image with a WildFly based distribution can be selected instead, for example: 'quay.io/keycloak/keycloak:19.0.3-legacy'. Note Keycloak Quarkus and Keycloak WildFly images are initialized differently. By default, Dev Services for Keycloak will assume it is a Keycloak Quarkus image if the image version does not end with a '-legacy' string. Set 'quarkus.keycloak.devservices.keycloak-x-image' to override this check. Environment variable: Show more |
string |
|
If Keycloak-X image is used. By default, Dev Services for Keycloak will assume a Keycloak-X image is used if the image name contains a 'keycloak-x' string. Set 'quarkus.keycloak.devservices.keycloak-x-image' to override this check which may be necessary if you build custom Keycloak-X or Keycloak images. You do not need to set this property if the default check works. Environment variable: Show more |
boolean |
|
Indicates if the Keycloak container managed by Quarkus Dev Services is shared. When shared, Quarkus looks for running containers using label-based service discovery. If a matching container is found, it is used, and so a second one is not started. Otherwise, Dev Services for Keycloak starts a new container.
The discovery uses the Environment variable: Show more |
boolean |
|
The value of the Environment variable: Show more |
string |
|
The comma-separated list of class or file system paths to Keycloak realm files which will be used to initialize Keycloak. The first value in this list will be used to initialize default tenant connection properties. Environment variable: Show more |
list of string |
|
The JAVA_OPTS passed to the keycloak JVM Environment variable: Show more |
string |
|
Show Keycloak log messages with a "Keycloak:" prefix. Environment variable: Show more |
boolean |
|
Keycloak start command. Use this property to experiment with Keycloak start options, see Environment variable: Show more |
string |
|
The Keycloak realm name. This property will be used to create the realm if the realm file pointed to by the 'realm-path' property does not exist, default value is 'quarkus' in this case. If the realm file pointed to by the 'realm-path' property exists then it is still recommended to set this property for Dev Services for Keycloak to avoid parsing the realm file in order to determine the realm name. Environment variable: Show more |
string |
|
Indicates if the Keycloak realm has to be created when the realm file pointed to by the 'realm-path' property does not exist. Disable it if you’d like to create a realm using Keycloak Administration Console or Keycloak Admin API from Environment variable: Show more |
boolean |
|
Optional fixed port the dev service will listen to. If not defined, the port will be chosen randomly. Environment variable: Show more |
int |
|
The Keycloak users map containing the username and password pairs. If this map is empty then two users, 'alice' and 'bob' with the passwords matching their names will be created. This property will be used to create the Keycloak users if the realm file pointed to by the 'realm-path' property does not exist. Environment variable: Show more |
|
|
The Keycloak user roles. If this map is empty then a user named 'alice' will get 'admin' and 'user' roles and all other users will get a 'user' role. This property will be used to create the Keycloak roles if the realm file pointed to by the 'realm-path' property does not exist. Environment variable: Show more |
|
|
If the OIDC extension is enabled. Environment variable: Show more |
boolean |
|
Grant type which will be used to acquire a token to test the OIDC 'service' applications Environment variable: Show more |
|
|
The WebClient timeout. Use this property to configure how long an HTTP client used by Dev UI handlers will wait for a response when requesting tokens from OpenId Connect Provider and sending them to the service endpoint. Environment variable: Show more |
|
|
Enable the registration of the Default TokenIntrospection and UserInfo Cache implementation bean. Note it only allows to use the default implementation, one needs to configure it in order to activate it, please see Environment variable: Show more |
boolean |
|
The base URL of the OpenID Connect (OIDC) server, for example, Environment variable: Show more |
string |
|
Enables OIDC discovery. If the discovery is disabled then the OIDC endpoint URLs must be configured individually. Environment variable: Show more |
boolean |
|
Relative path or absolute URL of the OIDC token endpoint which issues access and refresh tokens. Environment variable: Show more |
string |
|
Relative path or absolute URL of the OIDC token revocation endpoint. Environment variable: Show more |
string |
|
The client-id of the application. Each application has a client-id that is used to identify the application Environment variable: Show more |
string |
|
The maximum amount of time connecting to the currently unavailable OIDC server will be attempted for. The number of times the connection request will be repeated is calculated by dividing the value of this property by 2. For example, setting it to Environment variable: Show more |
||
The number of times an attempt to re-establish an already available connection will be repeated for. Note this property is different to the Environment variable: Show more |
int |
|
The amount of time after which the current OIDC connection request will time out. Environment variable: Show more |
|
|
The maximum size of the connection pool used by the WebClient Environment variable: Show more |
int |
|
Client secret which is used for a Environment variable: Show more |
string |
|
The client secret value - it will be ignored if 'secret.key' is set Environment variable: Show more |
string |
|
The CredentialsProvider name which should only be set if more than one CredentialsProvider is registered Environment variable: Show more |
string |
|
The CredentialsProvider client secret key Environment variable: Show more |
string |
|
Authentication method. Environment variable: Show more |
|
|
If provided, indicates that JWT is signed using a secret key Environment variable: Show more |
string |
|
The CredentialsProvider name which should only be set if more than one CredentialsProvider is registered Environment variable: Show more |
string |
|
The CredentialsProvider client secret key Environment variable: Show more |
string |
|
If provided, indicates that JWT is signed using a private key in PEM or JWK format. You can use the Environment variable: Show more |
string |
|
If provided, indicates that JWT is signed using a private key from a key store Environment variable: Show more |
string |
|
A parameter to specify the password of the key store file. If not given, the default ("password") is used. Environment variable: Show more |
string |
|
The private key id/alias Environment variable: Show more |
string |
|
The private key password Environment variable: Show more |
string |
|
JWT audience ('aud') claim value. By default, the audience is set to the address of the OpenId Connect Provider’s token endpoint. Environment variable: Show more |
string |
|
Key identifier of the signing key added as a JWT 'kid' header Environment variable: Show more |
string |
|
Issuer of the signing key added as a JWT 'iss' claim (default: client id) Environment variable: Show more |
string |
|
Subject of the signing key added as a JWT 'sub' claim (default: client id) Environment variable: Show more |
string |
|
Signature algorithm, also used for the Environment variable: Show more |
string |
|
JWT life-span in seconds. It will be added to the time it was issued at to calculate the expiration time. Environment variable: Show more |
int |
|
The host (name or IP address) of the Proxy. Note: If OIDC adapter needs to use a Proxy to talk with OIDC server (Provider), then at least the "host" config item must be configured to enable the usage of a Proxy. Environment variable: Show more |
string |
|
The port number of the Proxy. Default value is 80. Environment variable: Show more |
int |
|
The username, if Proxy needs authentication. Environment variable: Show more |
string |
|
The password, if Proxy needs authentication. Environment variable: Show more |
string |
|
Certificate validation and hostname verification, which can be one of the following values from enum Environment variable: Show more |
|
|
An optional key store which holds the certificate information instead of specifying separate files. Environment variable: Show more |
path |
|
An optional parameter to specify type of the key store file. If not given, the type is automatically detected based on the file name. Environment variable: Show more |
string |
|
An optional parameter to specify a provider of the key store file. If not given, the provider is automatically detected based on the key store file type. Environment variable: Show more |
string |
|
A parameter to specify the password of the key store file. If not given, the default ("password") is used. Environment variable: Show more |
string |
|
An optional parameter to select a specific key in the key store. When SNI is disabled, if the key store contains multiple keys and no alias is specified, the behavior is undefined. Environment variable: Show more |
string |
|
An optional parameter to define the password for the key, in case it’s different from Environment variable: Show more |
string |
|
An optional trust store which holds the certificate information of the certificates to trust Environment variable: Show more |
path |
|
A parameter to specify the password of the trust store file. Environment variable: Show more |
string |
|
A parameter to specify the alias of the trust store certificate. Environment variable: Show more |
string |
|
An optional parameter to specify type of the trust store file. If not given, the type is automatically detected based on the file name. Environment variable: Show more |
string |
|
An optional parameter to specify a provider of the trust store file. If not given, the provider is automatically detected based on the trust store file type. Environment variable: Show more |
string |
|
A unique tenant identifier. It must be set by Environment variable: Show more |
string |
|
If this tenant configuration is enabled. Environment variable: Show more |
boolean |
|
The application type, which can be one of the following values from enum Environment variable: Show more |
|
|
Relative path or absolute URL of the OIDC authorization endpoint which authenticates the users. This property must be set for the 'web-app' applications if OIDC discovery is disabled. This property will be ignored if the discovery is enabled. Environment variable: Show more |
string |
|
Relative path or absolute URL of the OIDC userinfo endpoint. This property must only be set for the 'web-app' applications if OIDC discovery is disabled and 'authentication.user-info-required' property is enabled. This property will be ignored if the discovery is enabled. Environment variable: Show more |
string |
|
Relative path or absolute URL of the OIDC RFC7662 introspection endpoint which can introspect both opaque and JWT tokens. This property must be set if OIDC discovery is disabled and 1) the opaque bearer access tokens have to be verified or 2) JWT tokens have to be verified while the cached JWK verification set with no matching JWK is being refreshed. This property will be ignored if the discovery is enabled. Environment variable: Show more |
string |
|
Relative path or absolute URL of the OIDC JWKS endpoint which returns a JSON Web Key Verification Set. This property should be set if OIDC discovery is disabled and the local JWT verification is required. This property will be ignored if the discovery is enabled. Environment variable: Show more |
string |
|
Relative path or absolute URL of the OIDC end_session_endpoint. This property must be set if OIDC discovery is disabled and RP Initiated Logout support for the 'web-app' applications is required. This property will be ignored if the discovery is enabled. Environment variable: Show more |
string |
|
Public key for the local JWT token verification. OIDC server connection will not be created when this property is set. Environment variable: Show more |
string |
|
Name Environment variable: Show more |
string |
|
Secret Environment variable: Show more |
string |
|
Include OpenId Connect Client ID configured with 'quarkus.oidc.client-id' Environment variable: Show more |
boolean |
|
List of paths to claims containing an array of groups. Each path starts from the top level JWT JSON object and can contain multiple segments where each segment represents a JSON object name only, example: "realm/groups". Use double quotes with the namespace qualified claim names. This property can be used if a token has no 'groups' claim but has the groups set in one or more different claims. Environment variable: Show more |
list of string |
|
Separator for splitting a string which may contain multiple group values. It will only be used if the "role-claim-path" property points to one or more custom claims whose values are strings. A single space will be used by default because the standard 'scope' claim may contain a space separated sequence. Environment variable: Show more |
string |
|
Source of the principal roles. Environment variable: Show more |
|
|
Expected issuer 'iss' claim value. Note this property overrides the Environment variable: Show more |
string |
|
Expected audience 'aud' claim value which may be a string or an array of strings. Environment variable: Show more |
list of string |
|
Expected token type Environment variable: Show more |
string |
|
Life span grace period in seconds. When checking token expiry, current time is allowed to be later than token expiration time by at most the configured number of seconds. When checking token issuance, current time is allowed to be sooner than token issue time by at most the configured number of seconds. Environment variable: Show more |
int |
|
Token age. It allows for the number of seconds to be specified that must not elapse since the Environment variable: Show more |
||
Name of the claim which contains a principal name. By default, the 'upn', 'preferred_username' and Environment variable: Show more |
string |
|
Refresh expired authorization code flow ID or access tokens. If this property is enabled then a refresh token request will be performed if the authorization code ID or access token has expired and, if successful, the local session will be updated with the new set of tokens. Otherwise, the local session will be invalidated and the user redirected to the OpenID Provider to re-authenticate. In this case the user may not be challenged again if the OIDC provider session is still active. For this option be effective the Environment variable: Show more |
boolean |
|
Refresh token time skew in seconds. If this property is enabled then the configured number of seconds is added to the current time when checking if the authorization code ID or access token should be refreshed. If the sum is greater than the authorization code ID or access token’s expiration time then a refresh is going to happen. This property will be ignored if the 'refresh-expired' property is not enabled. Environment variable: Show more |
||
Forced JWK set refresh interval in minutes. Environment variable: Show more |
|
|
Custom HTTP header that contains a bearer token. This option is valid only when the application is of type Environment variable: Show more |
string |
|
Decryption key location. JWT tokens can be inner-signed and encrypted by OpenId Connect providers. However, it is not always possible to remotely introspect such tokens because the providers may not control the private decryption keys. In such cases set this property to point to the file containing the decryption private key in PEM or JSON Web Key (JWK) format. Note that if a 'private_key_jwt' client authentication method is used then the private key which is used to sign client authentication JWT tokens will be used to try to decrypt an encrypted ID token if this property is not set. Environment variable: Show more |
string |
|
Allow the remote introspection of JWT tokens when no matching JWK key is available. Note this property is set to 'true' by default for backward-compatibility reasons and will be set to Environment variable: Show more |
boolean |
|
Require that JWT tokens are only introspected remotely. Environment variable: Show more |
boolean |
|
Allow the remote introspection of the opaque tokens. Set this property to 'false' if only JWT tokens are expected. Environment variable: Show more |
boolean |
|
Indirectly verify that the opaque (binary) access token is valid by using it to request UserInfo. Opaque access token is considered valid if the provider accepted this token and returned a valid UserInfo. You should only enable this option if the opaque access tokens have to be accepted but OpenId Connect provider does not have a token introspection endpoint. This property will have no effect when JWT tokens have to be verified. Environment variable: Show more |
boolean |
|
The relative path of the logout endpoint at the application. If provided, the application is able to initiate the logout through this endpoint in conformance with the OpenID Connect RP-Initiated Logout specification. Environment variable: Show more |
string |
|
Relative path of the application endpoint where the user should be redirected to after logging out from the OpenID Connect Provider. This endpoint URI must be properly registered at the OpenID Connect Provider as a valid redirect URI. Environment variable: Show more |
string |
|
Name of the post logout URI parameter which will be added as a query parameter to the logout redirect URI. Environment variable: Show more |
string |
|
The relative path of the Back-Channel Logout endpoint at the application. Environment variable: Show more |
string |
|
The relative path of the Front-Channel Logout endpoint at the application. Environment variable: Show more |
string |
|
Authorization code flow response mode Environment variable: Show more |
|
|
Relative path for calculating a "redirect_uri" query parameter. It has to start from a forward slash and will be appended to the request URI’s host and port. For example, if the current request URI is 'https://localhost:8080/service' then a 'redirect_uri' parameter will be set to 'https://localhost:8080/' if this property is set to '/' and be the same as the request URI if this property has not been configured. Note the original request URI will be restored after the user has authenticated if 'restorePathAfterRedirect' is set to 'true'. Environment variable: Show more |
string |
|
If this property is set to 'true' then the original request URI which was used before the authentication will be restored after the user has been redirected back to the application. Note if Environment variable: Show more |
boolean |
|
Remove the query parameters such as 'code' and 'state' set by the OIDC server on the redirect URI after the user has authenticated by redirecting a user to the same URI but without the query parameters. Environment variable: Show more |
boolean |
|
Relative path to the public endpoint which will process the error response from the OIDC authorization endpoint. If the user authentication has failed then the OIDC provider will return an 'error' and an optional 'error_description' parameters, instead of the expected authorization 'code'. If this property is set then the user will be redirected to the endpoint which can return a user-friendly error description page. It has to start from a forward slash and will be appended to the request URI’s host and port. For example, if it is set as '/error' and the current request URI is 'https://localhost:8080/callback?error=invalid_scope' then a redirect will be made to 'https://localhost:8080/error?error=invalid_scope'. If this property is not set then HTTP 401 status will be returned in case of the user authentication failure. Environment variable: Show more |
string |
|
Both ID and access tokens are fetched from the OIDC provider as part of the authorization code flow. ID token is always verified on every user request as the primary token which is used to represent the principal and extract the roles. Access token is not verified by default since it is meant to be propagated to the downstream services. The verification of the access token should be enabled if it is injected as a JWT token. Access tokens obtained as part of the code flow will always be verified if Environment variable: Show more |
boolean |
|
Force 'https' as the 'redirect_uri' parameter scheme when running behind an SSL terminating reverse proxy. This property, if enabled, will also affect the logout Environment variable: Show more |
boolean |
|
List of scopes Environment variable: Show more |
list of string |
|
Add the 'openid' scope automatically to the list of scopes. This is required for OpenId Connect providers but will not work for OAuth2 providers such as Twitter OAuth2 which does not accept that scope and throws an error. Environment variable: Show more |
boolean |
|
Request URL query parameters which, if present, will be added to the authentication redirect URI. Environment variable: Show more |
list of string |
|
If enabled the state, session and post logout cookies will have their 'secure' parameter set to 'true' when HTTP is used. It may be necessary when running behind an SSL terminating reverse proxy. The cookies will always be secure if HTTPS is used even if this property is set to false. Environment variable: Show more |
boolean |
|
Cookie name suffix. For example, a session cookie name for the default OIDC tenant is 'q_session' but can be changed to 'q_session_test' if this property is set to 'test'. Environment variable: Show more |
string |
|
Cookie path parameter value which, if set, will be used to set a path parameter for the session, state and post logout cookies. The Environment variable: Show more |
string |
|
Cookie path header parameter value which, if set, identifies the incoming HTTP header whose value will be used to set a path parameter for the session, state and post logout cookies. If the header is missing then the Environment variable: Show more |
string |
|
Cookie domain parameter value which, if set, will be used for the session, state and post logout cookies. Environment variable: Show more |
string |
|
SameSite attribute for the session cookie. Environment variable: Show more |
|
|
If this property is set to 'true' then an OIDC UserInfo endpoint will be called. Environment variable: Show more |
boolean |
|
Session age extension in minutes. The user session age property is set to the value of the ID token life-span by default and the user will be redirected to the OIDC provider to re-authenticate once the session has expired. If this property is set to a non-zero value then the expired ID token can be refreshed before the session has expired. This property will be ignored if the Environment variable: Show more |
|
|
If this property is set to 'true' then a normal 302 redirect response will be returned if the request was initiated via JavaScript API such as XMLHttpRequest or Fetch and the current user needs to be (re)authenticated which may not be desirable for Single Page Applications since it automatically following the redirect may not work given that OIDC authorization endpoints typically do not support CORS. If this property is set to Environment variable: Show more |
boolean |
|
Requires that ID token is available when the authorization code flow completes. Disable this property only when you need to use the authorization code flow with OAuth2 providers which do not return ID token - an internal IdToken will be generated in such cases. Environment variable: Show more |
boolean |
|
Internal ID token lifespan. This property is only checked when an internal IdToken is generated when Oauth2 providers do not return IdToken. Environment variable: Show more |
|
|
Requires that a Proof Key for Code Exchange (PKCE) is used. Environment variable: Show more |
boolean |
|
Secret which will be used to encrypt a Proof Key for Code Exchange (PKCE) code verifier in the code flow state. This secret must be set if PKCE is required but no client secret is set. The length of the secret which will be used to encrypt the code verifier must be 32 characters long. Environment variable: Show more |
string |
|
Default TokenStateManager strategy. Environment variable: Show more |
|
|
Default TokenStateManager keeps all tokens (ID, access and refresh) returned in the authorization code grant response in a single session cookie by default. Enable this property to minimize a session cookie size Environment variable: Show more |
boolean |
|
Requires that the tokens are encrypted before being stored in the cookies. Environment variable: Show more |
boolean |
|
Secret which will be used to encrypt the tokens. This secret must be set if the token encryption is required but no client secret is set. The length of the secret which will be used to encrypt the tokens must be 32 characters long. Environment variable: Show more |
string |
|
Allow caching the token introspection data. Note enabling this property does not enable the cache itself but only permits to cache the token introspection for a given tenant. If the default token cache can be used then please see Environment variable: Show more |
boolean |
|
Allow caching the user info data. Note enabling this property does not enable the cache itself but only permits to cache the user info data for a given tenant. If the default token cache can be used then please see Environment variable: Show more |
boolean |
|
Allow inlining UserInfo in IdToken instead of caching it in the token cache. This property is only checked when an internal IdToken is generated when Oauth2 providers do not return IdToken. Inlining UserInfo in the generated IdToken allows to store it in the session cookie and avoids introducing a cached state. Environment variable: Show more |
boolean |
|
Well known OpenId Connect provider identifier Environment variable: Show more |
|
|
Maximum number of cache entries. Set it to a positive value if the cache has to be enabled. Environment variable: Show more |
int |
|
Maximum amount of time a given cache entry is valid for. Environment variable: Show more |
|
|
Clean up timer interval. If this property is set then a timer will check and remove the stale entries periodically. Environment variable: Show more |
||
Grant options Environment variable: Show more |
|
|
A map of required claims and their expected values. For example, Environment variable: Show more |
|
|
Additional properties which will be added as the query parameters to the logout redirect URI. Environment variable: Show more |
|
|
Additional properties which will be added as the query parameters to the authentication redirect URI. Environment variable: Show more |
|
|
Additional parameters, in addition to the required Environment variable: Show more |
|
|
Custom HTTP headers which have to be sent to complete the authorization code grant request. Environment variable: Show more |
|
|
类型 |
默认 |
|
The base URL of the OpenID Connect (OIDC) server, for example, Environment variable: Show more |
string |
|
Enables OIDC discovery. If the discovery is disabled then the OIDC endpoint URLs must be configured individually. Environment variable: Show more |
boolean |
|
Relative path or absolute URL of the OIDC token endpoint which issues access and refresh tokens. Environment variable: Show more |
string |
|
Relative path or absolute URL of the OIDC token revocation endpoint. Environment variable: Show more |
string |
|
The client-id of the application. Each application has a client-id that is used to identify the application Environment variable: Show more |
string |
|
The maximum amount of time connecting to the currently unavailable OIDC server will be attempted for. The number of times the connection request will be repeated is calculated by dividing the value of this property by 2. For example, setting it to Environment variable: Show more |
||
The number of times an attempt to re-establish an already available connection will be repeated for. Note this property is different to the Environment variable: Show more |
int |
|
The amount of time after which the current OIDC connection request will time out. Environment variable: Show more |
|
|
The maximum size of the connection pool used by the WebClient Environment variable: Show more |
int |
|
Client secret which is used for a Environment variable: Show more |
string |
|
The client secret value - it will be ignored if 'secret.key' is set Environment variable: Show more |
string |
|
The CredentialsProvider name which should only be set if more than one CredentialsProvider is registered Environment variable: Show more |
string |
|
The CredentialsProvider client secret key Environment variable: Show more |
string |
|
Authentication method. Environment variable: Show more |
|
|
If provided, indicates that JWT is signed using a secret key Environment variable: Show more |
string |
|
The CredentialsProvider name which should only be set if more than one CredentialsProvider is registered Environment variable: Show more |
string |
|
The CredentialsProvider client secret key Environment variable: Show more |
string |
|
If provided, indicates that JWT is signed using a private key in PEM or JWK format. You can use the Environment variable: Show more |
string |
|
If provided, indicates that JWT is signed using a private key from a key store Environment variable: Show more |
string |
|
A parameter to specify the password of the key store file. If not given, the default ("password") is used. Environment variable: Show more |
string |
|
The private key id/alias Environment variable: Show more |
string |
|
The private key password Environment variable: Show more |
string |
|
JWT audience ('aud') claim value. By default, the audience is set to the address of the OpenId Connect Provider’s token endpoint. Environment variable: Show more |
string |
|
Key identifier of the signing key added as a JWT 'kid' header Environment variable: Show more |
string |
|
Issuer of the signing key added as a JWT 'iss' claim (default: client id) Environment variable: Show more |
string |
|
Subject of the signing key added as a JWT 'sub' claim (default: client id) Environment variable: Show more |
string |
|
Signature algorithm, also used for the Environment variable: Show more |
string |
|
JWT life-span in seconds. It will be added to the time it was issued at to calculate the expiration time. Environment variable: Show more |
int |
|
The host (name or IP address) of the Proxy. Note: If OIDC adapter needs to use a Proxy to talk with OIDC server (Provider), then at least the "host" config item must be configured to enable the usage of a Proxy. Environment variable: Show more |
string |
|
The port number of the Proxy. Default value is 80. Environment variable: Show more |
int |
|
The username, if Proxy needs authentication. Environment variable: Show more |
string |
|
The password, if Proxy needs authentication. Environment variable: Show more |
string |
|
Certificate validation and hostname verification, which can be one of the following values from enum Environment variable: Show more |
|
|
An optional key store which holds the certificate information instead of specifying separate files. Environment variable: Show more |
path |
|
An optional parameter to specify type of the key store file. If not given, the type is automatically detected based on the file name. Environment variable: Show more |
string |
|
An optional parameter to specify a provider of the key store file. If not given, the provider is automatically detected based on the key store file type. Environment variable: Show more |
string |
|
A parameter to specify the password of the key store file. If not given, the default ("password") is used. Environment variable: Show more |
string |
|
An optional parameter to select a specific key in the key store. When SNI is disabled, if the key store contains multiple keys and no alias is specified, the behavior is undefined. Environment variable: Show more |
string |
|
An optional parameter to define the password for the key, in case it’s different from Environment variable: Show more |
string |
|
An optional trust store which holds the certificate information of the certificates to trust Environment variable: Show more |
path |
|
A parameter to specify the password of the trust store file. Environment variable: Show more |
string |
|
A parameter to specify the alias of the trust store certificate. Environment variable: Show more |
string |
|
An optional parameter to specify type of the trust store file. If not given, the type is automatically detected based on the file name. Environment variable: Show more |
string |
|
An optional parameter to specify a provider of the trust store file. If not given, the provider is automatically detected based on the trust store file type. Environment variable: Show more |
string |
|
A unique tenant identifier. It must be set by Environment variable: Show more |
string |
|
If this tenant configuration is enabled. Environment variable: Show more |
boolean |
|
The application type, which can be one of the following values from enum Environment variable: Show more |
|
|
Relative path or absolute URL of the OIDC authorization endpoint which authenticates the users. This property must be set for the 'web-app' applications if OIDC discovery is disabled. This property will be ignored if the discovery is enabled. Environment variable: Show more |
string |
|
Relative path or absolute URL of the OIDC userinfo endpoint. This property must only be set for the 'web-app' applications if OIDC discovery is disabled and 'authentication.user-info-required' property is enabled. This property will be ignored if the discovery is enabled. Environment variable: Show more |
string |
|
Relative path or absolute URL of the OIDC RFC7662 introspection endpoint which can introspect both opaque and JWT tokens. This property must be set if OIDC discovery is disabled and 1) the opaque bearer access tokens have to be verified or 2) JWT tokens have to be verified while the cached JWK verification set with no matching JWK is being refreshed. This property will be ignored if the discovery is enabled. Environment variable: Show more |
string |
|
Relative path or absolute URL of the OIDC JWKS endpoint which returns a JSON Web Key Verification Set. This property should be set if OIDC discovery is disabled and the local JWT verification is required. This property will be ignored if the discovery is enabled. Environment variable: Show more |
string |
|
Relative path or absolute URL of the OIDC end_session_endpoint. This property must be set if OIDC discovery is disabled and RP Initiated Logout support for the 'web-app' applications is required. This property will be ignored if the discovery is enabled. Environment variable: Show more |
string |
|
Public key for the local JWT token verification. OIDC server connection will not be created when this property is set. Environment variable: Show more |
string |
|
Name Environment variable: Show more |
string |
|
Secret Environment variable: Show more |
string |
|
Include OpenId Connect Client ID configured with 'quarkus.oidc.client-id' Environment variable: Show more |
boolean |
|
List of paths to claims containing an array of groups. Each path starts from the top level JWT JSON object and can contain multiple segments where each segment represents a JSON object name only, example: "realm/groups". Use double quotes with the namespace qualified claim names. This property can be used if a token has no 'groups' claim but has the groups set in one or more different claims. Environment variable: Show more |
list of string |
|
Separator for splitting a string which may contain multiple group values. It will only be used if the "role-claim-path" property points to one or more custom claims whose values are strings. A single space will be used by default because the standard 'scope' claim may contain a space separated sequence. Environment variable: Show more |
string |
|
Source of the principal roles. Environment variable: Show more |
|
|
Expected issuer 'iss' claim value. Note this property overrides the Environment variable: Show more |
string |
|
Expected audience 'aud' claim value which may be a string or an array of strings. Environment variable: Show more |
list of string |
|
A map of required claims and their expected values. For example, Environment variable: Show more |
|
|
Expected token type Environment variable: Show more |
string |
|
Life span grace period in seconds. When checking token expiry, current time is allowed to be later than token expiration time by at most the configured number of seconds. When checking token issuance, current time is allowed to be sooner than token issue time by at most the configured number of seconds. Environment variable: Show more |
int |
|
Token age. It allows for the number of seconds to be specified that must not elapse since the Environment variable: Show more |
||
Name of the claim which contains a principal name. By default, the 'upn', 'preferred_username' and Environment variable: Show more |
string |
|
Refresh expired authorization code flow ID or access tokens. If this property is enabled then a refresh token request will be performed if the authorization code ID or access token has expired and, if successful, the local session will be updated with the new set of tokens. Otherwise, the local session will be invalidated and the user redirected to the OpenID Provider to re-authenticate. In this case the user may not be challenged again if the OIDC provider session is still active. For this option be effective the Environment variable: Show more |
boolean |
|
Refresh token time skew in seconds. If this property is enabled then the configured number of seconds is added to the current time when checking if the authorization code ID or access token should be refreshed. If the sum is greater than the authorization code ID or access token’s expiration time then a refresh is going to happen. This property will be ignored if the 'refresh-expired' property is not enabled. Environment variable: Show more |
||
Forced JWK set refresh interval in minutes. Environment variable: Show more |
|
|
Custom HTTP header that contains a bearer token. This option is valid only when the application is of type Environment variable: Show more |
string |
|
Decryption key location. JWT tokens can be inner-signed and encrypted by OpenId Connect providers. However, it is not always possible to remotely introspect such tokens because the providers may not control the private decryption keys. In such cases set this property to point to the file containing the decryption private key in PEM or JSON Web Key (JWK) format. Note that if a 'private_key_jwt' client authentication method is used then the private key which is used to sign client authentication JWT tokens will be used to try to decrypt an encrypted ID token if this property is not set. Environment variable: Show more |
string |
|
Allow the remote introspection of JWT tokens when no matching JWK key is available. Note this property is set to 'true' by default for backward-compatibility reasons and will be set to Environment variable: Show more |
boolean |
|
Require that JWT tokens are only introspected remotely. Environment variable: Show more |
boolean |
|
Allow the remote introspection of the opaque tokens. Set this property to 'false' if only JWT tokens are expected. Environment variable: Show more |
boolean |
|
Indirectly verify that the opaque (binary) access token is valid by using it to request UserInfo. Opaque access token is considered valid if the provider accepted this token and returned a valid UserInfo. You should only enable this option if the opaque access tokens have to be accepted but OpenId Connect provider does not have a token introspection endpoint. This property will have no effect when JWT tokens have to be verified. Environment variable: Show more |
boolean |
|
The relative path of the logout endpoint at the application. If provided, the application is able to initiate the logout through this endpoint in conformance with the OpenID Connect RP-Initiated Logout specification. Environment variable: Show more |
string |
|
Relative path of the application endpoint where the user should be redirected to after logging out from the OpenID Connect Provider. This endpoint URI must be properly registered at the OpenID Connect Provider as a valid redirect URI. Environment variable: Show more |
string |
|
Name of the post logout URI parameter which will be added as a query parameter to the logout redirect URI. Environment variable: Show more |
string |
|
Additional properties which will be added as the query parameters to the logout redirect URI. Environment variable: Show more |
|
|
The relative path of the Back-Channel Logout endpoint at the application. Environment variable: Show more |
string |
|
The relative path of the Front-Channel Logout endpoint at the application. Environment variable: Show more |
string |
|
Authorization code flow response mode Environment variable: Show more |
|
|
Relative path for calculating a "redirect_uri" query parameter. It has to start from a forward slash and will be appended to the request URI’s host and port. For example, if the current request URI is 'https://localhost:8080/service' then a 'redirect_uri' parameter will be set to 'https://localhost:8080/' if this property is set to '/' and be the same as the request URI if this property has not been configured. Note the original request URI will be restored after the user has authenticated if 'restorePathAfterRedirect' is set to 'true'. Environment variable: Show more |
string |
|
If this property is set to 'true' then the original request URI which was used before the authentication will be restored after the user has been redirected back to the application. Note if Environment variable: Show more |
boolean |
|
Remove the query parameters such as 'code' and 'state' set by the OIDC server on the redirect URI after the user has authenticated by redirecting a user to the same URI but without the query parameters. Environment variable: Show more |
boolean |
|
Relative path to the public endpoint which will process the error response from the OIDC authorization endpoint. If the user authentication has failed then the OIDC provider will return an 'error' and an optional 'error_description' parameters, instead of the expected authorization 'code'. If this property is set then the user will be redirected to the endpoint which can return a user-friendly error description page. It has to start from a forward slash and will be appended to the request URI’s host and port. For example, if it is set as '/error' and the current request URI is 'https://localhost:8080/callback?error=invalid_scope' then a redirect will be made to 'https://localhost:8080/error?error=invalid_scope'. If this property is not set then HTTP 401 status will be returned in case of the user authentication failure. Environment variable: Show more |
string |
|
Both ID and access tokens are fetched from the OIDC provider as part of the authorization code flow. ID token is always verified on every user request as the primary token which is used to represent the principal and extract the roles. Access token is not verified by default since it is meant to be propagated to the downstream services. The verification of the access token should be enabled if it is injected as a JWT token. Access tokens obtained as part of the code flow will always be verified if Environment variable: Show more |
boolean |
|
Force 'https' as the 'redirect_uri' parameter scheme when running behind an SSL terminating reverse proxy. This property, if enabled, will also affect the logout Environment variable: Show more |
boolean |
|
List of scopes Environment variable: Show more |
list of string |
|
Add the 'openid' scope automatically to the list of scopes. This is required for OpenId Connect providers but will not work for OAuth2 providers such as Twitter OAuth2 which does not accept that scope and throws an error. Environment variable: Show more |
boolean |
|
Additional properties which will be added as the query parameters to the authentication redirect URI. Environment variable: Show more |
|
|
Request URL query parameters which, if present, will be added to the authentication redirect URI. Environment variable: Show more |
list of string |
|
If enabled the state, session and post logout cookies will have their 'secure' parameter set to 'true' when HTTP is used. It may be necessary when running behind an SSL terminating reverse proxy. The cookies will always be secure if HTTPS is used even if this property is set to false. Environment variable: Show more |
boolean |
|
Cookie name suffix. For example, a session cookie name for the default OIDC tenant is 'q_session' but can be changed to 'q_session_test' if this property is set to 'test'. Environment variable: Show more |
string |
|
Cookie path parameter value which, if set, will be used to set a path parameter for the session, state and post logout cookies. The Environment variable: Show more |
string |
|
Cookie path header parameter value which, if set, identifies the incoming HTTP header whose value will be used to set a path parameter for the session, state and post logout cookies. If the header is missing then the Environment variable: Show more |
string |
|
Cookie domain parameter value which, if set, will be used for the session, state and post logout cookies. Environment variable: Show more |
string |
|
SameSite attribute for the session cookie. Environment variable: Show more |
|
|
If this property is set to 'true' then an OIDC UserInfo endpoint will be called. Environment variable: Show more |
boolean |
|
Session age extension in minutes. The user session age property is set to the value of the ID token life-span by default and the user will be redirected to the OIDC provider to re-authenticate once the session has expired. If this property is set to a non-zero value then the expired ID token can be refreshed before the session has expired. This property will be ignored if the Environment variable: Show more |
|
|
If this property is set to 'true' then a normal 302 redirect response will be returned if the request was initiated via JavaScript API such as XMLHttpRequest or Fetch and the current user needs to be (re)authenticated which may not be desirable for Single Page Applications since it automatically following the redirect may not work given that OIDC authorization endpoints typically do not support CORS. If this property is set to Environment variable: Show more |
boolean |
|
Requires that ID token is available when the authorization code flow completes. Disable this property only when you need to use the authorization code flow with OAuth2 providers which do not return ID token - an internal IdToken will be generated in such cases. Environment variable: Show more |
boolean |
|
Internal ID token lifespan. This property is only checked when an internal IdToken is generated when Oauth2 providers do not return IdToken. Environment variable: Show more |
|
|
Requires that a Proof Key for Code Exchange (PKCE) is used. Environment variable: Show more |
boolean |
|
Secret which will be used to encrypt a Proof Key for Code Exchange (PKCE) code verifier in the code flow state. This secret must be set if PKCE is required but no client secret is set. The length of the secret which will be used to encrypt the code verifier must be 32 characters long. Environment variable: Show more |
string |
|
Additional parameters, in addition to the required Environment variable: Show more |
|
|
Custom HTTP headers which have to be sent to complete the authorization code grant request. Environment variable: Show more |
|
|
Default TokenStateManager strategy. Environment variable: Show more |
|
|
Default TokenStateManager keeps all tokens (ID, access and refresh) returned in the authorization code grant response in a single session cookie by default. Enable this property to minimize a session cookie size Environment variable: Show more |
boolean |
|
Requires that the tokens are encrypted before being stored in the cookies. Environment variable: Show more |
boolean |
|
Secret which will be used to encrypt the tokens. This secret must be set if the token encryption is required but no client secret is set. The length of the secret which will be used to encrypt the tokens must be 32 characters long. Environment variable: Show more |
string |
|
Allow caching the token introspection data. Note enabling this property does not enable the cache itself but only permits to cache the token introspection for a given tenant. If the default token cache can be used then please see Environment variable: Show more |
boolean |
|
Allow caching the user info data. Note enabling this property does not enable the cache itself but only permits to cache the user info data for a given tenant. If the default token cache can be used then please see Environment variable: Show more |
boolean |
|
Allow inlining UserInfo in IdToken instead of caching it in the token cache. This property is only checked when an internal IdToken is generated when Oauth2 providers do not return IdToken. Inlining UserInfo in the generated IdToken allows to store it in the session cookie and avoids introducing a cached state. Environment variable: Show more |
boolean |
|
Well known OpenId Connect provider identifier Environment variable: Show more |
|
|
About the Duration format
持续时间的格式使用标准的 您还可以提供以数字开头的持续时间值。 在这种情况下,如果该值仅包含一个数字,则转换器将该值视为秒。 否则, |