diff --git a/forms/common-themes/src/main/resources/theme/base/admin/messages/admin-messages_de.properties b/forms/common-themes/src/main/resources/theme/base/admin/messages/admin-messages_de.properties index 46b663c0ec..10549e1fe0 100644 --- a/forms/common-themes/src/main/resources/theme/base/admin/messages/admin-messages_de.properties +++ b/forms/common-themes/src/main/resources/theme/base/admin/messages/admin-messages_de.properties @@ -132,6 +132,15 @@ multivalued.label=de Multivalued multivalued.tooltip=de Indicates if attribute supports multiple values. If true, then the list of all values of this attribute will be set as claim. If false, then just first value will be set as claim selectRole.label=de Select Role selectRole.tooltip=de Enter role in the textbox to the left, or click this button to browse and select the role you want +tokenClaimName.label=de Token Claim Name +tokenClaimName.tooltip=de Name of the claim to insert into the token. This can be a fully qualified name like 'address.street'. In this case, a nested json object will be created. +jsonType.label=de Claim JSON Type +jsonType.tooltip=de JSON type that should be used to populate the json claim in the token. long, int, boolean, and String are valid values. +includeInIdToken.label=de Add to ID token +includeInIdTokenTooltip.Should the claim be added to the ID token? +includeInAccessToken.label=de Add to access token +includeInAccessToken.tooltip=de Should the claim be added to the access token? + # client details clients.tooltip=de Clients are trusted browser apps and web services in a realm. These clients can request a login. You can also define client specific roles. diff --git a/forms/common-themes/src/main/resources/theme/base/admin/messages/admin-messages_en.properties b/forms/common-themes/src/main/resources/theme/base/admin/messages/admin-messages_en.properties index 6c47bf4a48..d5193e7f7a 100644 --- a/forms/common-themes/src/main/resources/theme/base/admin/messages/admin-messages_en.properties +++ b/forms/common-themes/src/main/resources/theme/base/admin/messages/admin-messages_en.properties @@ -132,6 +132,15 @@ multivalued.label=Multivalued multivalued.tooltip=Indicates if attribute supports multiple values. If true, then the list of all values of this attribute will be set as claim. If false, then just first value will be set as claim selectRole.label=Select Role selectRole.tooltip=Enter role in the textbox to the left, or click this button to browse and select the role you want. +tokenClaimName.label=Token Claim Name +tokenClaimName.tooltip=Name of the claim to insert into the token. This can be a fully qualified name like 'address.street'. In this case, a nested json object will be created. +jsonType.label=Claim JSON Type +jsonType.tooltip=JSON type that should be used to populate the json claim in the token. long, int, boolean, and String are valid values. +includeInIdToken.label=Add to ID token +includeInIdTokenTooltip.Should the claim be added to the ID token? +includeInAccessToken.label=Add to access token +includeInAccessToken.tooltip=Should the claim be added to the access token? + # client details clients.tooltip=Clients are trusted browser apps and web services in a realm. These clients can request a login. You can also define client specific roles. diff --git a/services/src/main/java/org/keycloak/protocol/oidc/mappers/OIDCAttributeMapperHelper.java b/services/src/main/java/org/keycloak/protocol/oidc/mappers/OIDCAttributeMapperHelper.java index ed83068608..227bd0c43b 100755 --- a/services/src/main/java/org/keycloak/protocol/oidc/mappers/OIDCAttributeMapperHelper.java +++ b/services/src/main/java/org/keycloak/protocol/oidc/mappers/OIDCAttributeMapperHelper.java @@ -2,12 +2,9 @@ package org.keycloak.protocol.oidc.mappers; import org.jboss.logging.Logger; import org.keycloak.models.ProtocolMapperModel; -import org.keycloak.models.RealmModel; -import org.keycloak.protocol.ProtocolMapper; import org.keycloak.protocol.ProtocolMapperUtils; import org.keycloak.protocol.oidc.OIDCLoginProtocol; import org.keycloak.provider.ProviderConfigProperty; -import org.keycloak.representations.AccessToken; import org.keycloak.representations.IDToken; import java.util.ArrayList; @@ -23,14 +20,16 @@ public class OIDCAttributeMapperHelper { private static final Logger logger = Logger.getLogger(OIDCAttributeMapperHelper.class); public static final String TOKEN_CLAIM_NAME = "claim.name"; - public static final String TOKEN_CLAIM_NAME_LABEL = "Token Claim Name"; - public static final String JSON_TYPE = "Claim JSON Type"; + public static final String TOKEN_CLAIM_NAME_LABEL = "tokenClaimName.label"; + public static final String TOKEN_CLAIM_NAME_TOOLTIP = "tokenClaimName.tooltip"; + public static final String JSON_TYPE = "jsonType.label"; + public static final String JSON_TYPE_TOOLTIP = "jsonType.tooltip"; public static final String INCLUDE_IN_ACCESS_TOKEN = "access.token.claim"; - public static final String INCLUDE_IN_ACCESS_TOKEN_LABEL = "Add to access token"; - public static final String INCLUDE_IN_ACCESS_TOKEN_HELP_TEXT = "Should the claim be added to the access token?"; + public static final String INCLUDE_IN_ACCESS_TOKEN_LABEL = "includeInAccessToken.label"; + public static final String INCLUDE_IN_ACCESS_TOKEN_HELP_TEXT = "includeInAccessToken.tooltip"; public static final String INCLUDE_IN_ID_TOKEN = "id.token.claim"; - public static final String INCLUDE_IN_ID_TOKEN_LABEL = "Add to ID token"; - public static final String INCLUDE_IN_ID_TOKEN_HELP_TEXT = "Should the claim be added to the ID token?"; + public static final String INCLUDE_IN_ID_TOKEN_LABEL = "includeInIdToken.label"; + public static final String INCLUDE_IN_ID_TOKEN_HELP_TEXT = "includeInIdToken.tooltip"; public static Object mapAttributeValue(ProtocolMapperModel mappingModel, Object attributeValue) { if (attributeValue == null) return null; @@ -139,7 +138,7 @@ public class OIDCAttributeMapperHelper { property.setName(TOKEN_CLAIM_NAME); property.setLabel(TOKEN_CLAIM_NAME_LABEL); property.setType(ProviderConfigProperty.STRING_TYPE); - property.setHelpText("Name of the claim to insert into the token. This can be a fully qualified name like 'address.street'. In this case, a nested json object will be created."); + property.setHelpText(TOKEN_CLAIM_NAME_TOOLTIP); configProperties.add(property); property = new ProviderConfigProperty(); property.setName(JSON_TYPE); @@ -151,7 +150,7 @@ public class OIDCAttributeMapperHelper { types.add("boolean"); property.setType(ProviderConfigProperty.LIST_TYPE); property.setDefaultValue(types); - property.setHelpText("JSON type that should be used to populate the json claim in the token. long, int, boolean, and String are valid values."); + property.setHelpText(JSON_TYPE_TOOLTIP); configProperties.add(property); property = new ProviderConfigProperty(); property.setName(INCLUDE_IN_ID_TOKEN);