2016-02-03 10:20:22 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2016 Red Hat, Inc. and/or its affiliates
|
|
|
|
* and other contributors as indicated by the @author tags.
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2015-07-17 11:45:43 +00:00
|
|
|
package org.keycloak.models;
|
|
|
|
|
2015-09-23 10:52:37 +00:00
|
|
|
import org.keycloak.OAuth2Constants;
|
2019-10-01 13:17:38 +00:00
|
|
|
import org.keycloak.crypto.Algorithm;
|
2015-09-23 10:52:37 +00:00
|
|
|
|
2017-03-31 21:11:52 +00:00
|
|
|
import java.util.Arrays;
|
|
|
|
import java.util.Collection;
|
2019-03-13 20:18:37 +00:00
|
|
|
import java.util.regex.Pattern;
|
2017-03-31 21:11:52 +00:00
|
|
|
|
2015-07-17 11:45:43 +00:00
|
|
|
/**
|
|
|
|
* @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
|
|
|
|
* @version $Revision: 1 $
|
|
|
|
*/
|
2019-03-13 20:18:37 +00:00
|
|
|
public final class Constants {
|
|
|
|
public static final String ADMIN_CONSOLE_CLIENT_ID = "security-admin-console";
|
|
|
|
public static final String ADMIN_CLI_CLIENT_ID = "admin-cli";
|
2015-07-17 11:45:43 +00:00
|
|
|
|
2019-03-13 20:18:37 +00:00
|
|
|
public static final String ACCOUNT_MANAGEMENT_CLIENT_ID = "account";
|
2019-11-19 08:52:31 +00:00
|
|
|
public static final String ACCOUNT_CONSOLE_CLIENT_ID = "account-console";
|
2019-03-13 20:18:37 +00:00
|
|
|
public static final String BROKER_SERVICE_CLIENT_ID = "broker";
|
|
|
|
public static final String REALM_MANAGEMENT_CLIENT_ID = "realm-management";
|
2015-07-17 11:45:43 +00:00
|
|
|
|
2019-10-16 08:33:55 +00:00
|
|
|
public static final String AUTH_BASE_URL_PROP = "${authBaseUrl}";
|
|
|
|
public static final String AUTH_ADMIN_URL_PROP = "${authAdminUrl}";
|
|
|
|
|
2019-03-13 20:18:37 +00:00
|
|
|
public static final Collection<String> defaultClients = Arrays.asList(ACCOUNT_MANAGEMENT_CLIENT_ID, ADMIN_CLI_CLIENT_ID, BROKER_SERVICE_CLIENT_ID, REALM_MANAGEMENT_CLIENT_ID, ADMIN_CONSOLE_CLIENT_ID);
|
2017-03-31 21:11:52 +00:00
|
|
|
|
2019-03-13 20:18:37 +00:00
|
|
|
public static final String INSTALLED_APP_URN = "urn:ietf:wg:oauth:2.0:oob";
|
|
|
|
public static final String INSTALLED_APP_URL = "http://localhost";
|
2020-11-20 08:06:22 +00:00
|
|
|
public static final String INSTALLED_APP_LOOPBACK = "http://127.0.0.1";
|
|
|
|
|
2019-03-13 20:18:37 +00:00
|
|
|
public static final String READ_TOKEN_ROLE = "read-token";
|
|
|
|
public static final String[] BROKER_SERVICE_ROLES = {READ_TOKEN_ROLE};
|
|
|
|
public static final String OFFLINE_ACCESS_ROLE = OAuth2Constants.OFFLINE_ACCESS;
|
2020-10-27 12:17:26 +00:00
|
|
|
public static final String DEFAULT_ROLES_ROLE_PREFIX = "default-roles";
|
2015-10-14 15:45:46 +00:00
|
|
|
|
2019-03-13 20:18:37 +00:00
|
|
|
public static final String AUTHZ_UMA_PROTECTION = "uma_protection";
|
|
|
|
public static final String AUTHZ_UMA_AUTHORIZATION = "uma_authorization";
|
|
|
|
public static final String[] AUTHZ_DEFAULT_AUTHORIZATION_ROLES = {AUTHZ_UMA_AUTHORIZATION};
|
2016-06-17 05:07:34 +00:00
|
|
|
|
2015-11-27 07:29:50 +00:00
|
|
|
// 15 minutes
|
2019-03-13 20:18:37 +00:00
|
|
|
public static final int DEFAULT_ACCESS_TOKEN_LIFESPAN_FOR_IMPLICIT_FLOW_TIMEOUT = 900;
|
2015-10-14 15:45:46 +00:00
|
|
|
// 30 days
|
2019-03-13 20:18:37 +00:00
|
|
|
public static final int DEFAULT_OFFLINE_SESSION_IDLE_TIMEOUT = 2592000;
|
2018-06-25 00:27:50 +00:00
|
|
|
// KEYCLOAK-7688 Offline Session Max for Offline Token
|
|
|
|
// 60 days
|
2019-03-13 20:18:37 +00:00
|
|
|
public static final int DEFAULT_OFFLINE_SESSION_MAX_LIFESPAN = 5184000;
|
2021-03-08 00:23:51 +00:00
|
|
|
public static final String DEFAULT_SIGNATURE_ALGORITHM = Algorithm.RS256;
|
2015-10-23 20:05:27 +00:00
|
|
|
|
2023-05-26 15:41:27 +00:00
|
|
|
public static final int DEFAULT_SESSION_IDLE_TIMEOUT = 1800; // 30 minutes
|
|
|
|
public static final int DEFAULT_SESSION_MAX_LIFESPAN = 36000; // 10 hours
|
|
|
|
|
2019-10-01 13:17:38 +00:00
|
|
|
public static final String DEFAULT_WEBAUTHN_POLICY_SIGNATURE_ALGORITHMS = Algorithm.ES256;
|
|
|
|
public static final String DEFAULT_WEBAUTHN_POLICY_RP_ENTITY_NAME = "keycloak";
|
|
|
|
// it stands for optional parameter not specified in WebAuthn
|
|
|
|
public static final String DEFAULT_WEBAUTHN_POLICY_NOT_SPECIFIED = "not specified";
|
|
|
|
|
2020-01-29 08:33:45 +00:00
|
|
|
// Prefix used for the realm attributes and other places
|
|
|
|
public static final String WEBAUTHN_PASSWORDLESS_PREFIX = "Passwordless";
|
|
|
|
|
2019-03-13 20:18:37 +00:00
|
|
|
public static final String VERIFY_EMAIL_KEY = "VERIFY_EMAIL_KEY";
|
|
|
|
public static final String EXECUTION = "execution";
|
|
|
|
public static final String CLIENT_ID = "client_id";
|
|
|
|
public static final String TAB_ID = "tab_id";
|
|
|
|
public static final String KEY = "key";
|
2019-11-04 11:20:58 +00:00
|
|
|
|
2019-07-16 19:09:09 +00:00
|
|
|
public static final String KC_ACTION = "kc_action";
|
2019-11-04 11:53:29 +00:00
|
|
|
public static final String KC_ACTION_STATUS = "kc_action_status";
|
|
|
|
public static final String KC_ACTION_EXECUTING = "kc_action_executing";
|
2019-11-04 11:20:58 +00:00
|
|
|
public static final int KC_ACTION_MAX_AGE = 300;
|
|
|
|
|
2019-07-16 19:09:09 +00:00
|
|
|
public static final String IS_AIA_REQUEST = "IS_AIA_REQUEST";
|
2019-07-25 22:24:33 +00:00
|
|
|
public static final String AIA_SILENT_CANCEL = "silent_cancel";
|
2019-11-14 13:45:05 +00:00
|
|
|
public static final String AUTHENTICATION_EXECUTION = "authenticationExecution";
|
|
|
|
public static final String CREDENTIAL_ID = "credentialId";
|
2015-12-01 12:15:06 +00:00
|
|
|
|
2019-03-13 20:18:37 +00:00
|
|
|
public static final String SKIP_LINK = "skipLink";
|
|
|
|
public static final String TEMPLATE_ATTR_ACTION_URI = "actionUri";
|
|
|
|
public static final String TEMPLATE_ATTR_REQUIRED_ACTIONS = "requiredActions";
|
2017-05-19 13:28:04 +00:00
|
|
|
|
2015-12-01 12:15:06 +00:00
|
|
|
// Prefix for user attributes used in various "context"data maps
|
2019-03-13 20:18:37 +00:00
|
|
|
public static final String USER_ATTRIBUTES_PREFIX = "user.attributes.";
|
2016-09-06 18:15:00 +00:00
|
|
|
|
2021-05-20 17:54:40 +00:00
|
|
|
// Roles already granted by a mapper when updating brokered users.
|
|
|
|
public static final String MAPPER_GRANTED_ROLES = "MAPPER_GRANTED_ROLES";
|
|
|
|
|
2021-09-13 11:32:35 +00:00
|
|
|
// Groups already assigned by a mapper when updating brokered users.
|
|
|
|
public static final String MAPPER_GRANTED_GROUPS = "MAPPER_GRANTED_GROUPS";
|
|
|
|
|
2016-09-06 18:15:00 +00:00
|
|
|
// Indication to admin-rest-endpoint that realm keys should be re-generated
|
2019-03-13 20:18:37 +00:00
|
|
|
public static final String GENERATE = "GENERATE";
|
2016-10-28 07:15:05 +00:00
|
|
|
|
2019-03-13 20:18:37 +00:00
|
|
|
public static final int DEFAULT_MAX_RESULTS = 100;
|
2018-06-08 13:38:38 +00:00
|
|
|
|
2019-03-13 20:18:37 +00:00
|
|
|
// Delimiter to be used in the configuration of authenticators (and some other components) in case that we need to save
|
|
|
|
// multiple values into single string
|
|
|
|
public static final String CFG_DELIMITER = "##";
|
|
|
|
|
|
|
|
// Better performance to use this instead of String.split
|
|
|
|
public static final Pattern CFG_DELIMITER_PATTERN = Pattern.compile("\\s*" + CFG_DELIMITER + "\\s*");
|
|
|
|
|
|
|
|
public static final String OFFLINE_ACCESS_SCOPE_CONSENT_TEXT = "${offlineAccessScopeConsentText}";
|
2021-01-29 12:35:19 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* If set as an attribute in the {@link KeycloakSession}, indicates that the storage should batch write operations.
|
|
|
|
*/
|
|
|
|
public static final String STORAGE_BATCH_ENABLED = "org.keycloak.storage.batch_enabled";
|
|
|
|
|
|
|
|
/**
|
|
|
|
* If {@code #STORAGE_BATCH_ENABLED} is set, indicates the batch size.
|
|
|
|
*/
|
|
|
|
public static final String STORAGE_BATCH_SIZE = "org.keycloak.storage.batch_size";
|
2019-05-01 15:22:24 +00:00
|
|
|
|
2021-05-12 14:19:55 +00:00
|
|
|
// Client Polices Realm Attributes Keys
|
|
|
|
public static final String CLIENT_PROFILES = "client-policies.profiles";
|
|
|
|
public static final String CLIENT_POLICIES = "client-policies.policies";
|
|
|
|
|
2021-12-22 11:43:12 +00:00
|
|
|
|
2022-02-23 16:25:27 +00:00
|
|
|
// Authentication session note, which contains loa of current authentication in progress
|
2021-12-22 11:43:12 +00:00
|
|
|
public static final String LEVEL_OF_AUTHENTICATION = "level-of-authentication";
|
2022-02-23 16:25:27 +00:00
|
|
|
|
|
|
|
// Authentication session (and user session) note, which contains map with authenticated levels and the times of their authentications,
|
|
|
|
// so it is possible to check when particular level expires and needs to be re-authenticated
|
|
|
|
public static final String LOA_MAP = "loa-map";
|
|
|
|
|
2021-12-22 11:43:12 +00:00
|
|
|
public static final String REQUESTED_LEVEL_OF_AUTHENTICATION = "requested-level-of-authentication";
|
|
|
|
public static final String FORCE_LEVEL_OF_AUTHENTICATION = "force-level-of-authentication";
|
|
|
|
public static final String ACR_LOA_MAP = "acr.loa.map";
|
2022-02-22 06:54:30 +00:00
|
|
|
public static final String DEFAULT_ACR_VALUES = "default.acr.values";
|
2021-12-22 11:43:12 +00:00
|
|
|
public static final int MINIMUM_LOA = 0;
|
|
|
|
public static final int NO_LOA = -1;
|
2022-10-05 18:40:31 +00:00
|
|
|
|
|
|
|
public static final Boolean REALM_ATTR_USERNAME_CASE_SENSITIVE_DEFAULT = Boolean.FALSE;
|
|
|
|
public static final String REALM_ATTR_USERNAME_CASE_SENSITIVE = "keycloak.username-search.case-sensitive";
|
2022-11-03 15:35:57 +00:00
|
|
|
|
2015-07-17 11:45:43 +00:00
|
|
|
}
|