use of org.keycloak.models.ProtocolMapperModel in project keycloak by keycloak.
the class HardcodedClaim method create.
public static ProtocolMapperModel create(String name, String hardcodedName, String hardcodedValue, String claimType, boolean accessToken, boolean idToken) {
ProtocolMapperModel mapper = new ProtocolMapperModel();
mapper.setName(name);
mapper.setProtocolMapper(PROVIDER_ID);
mapper.setProtocol(OIDCLoginProtocol.LOGIN_PROTOCOL);
Map<String, String> config = new HashMap<>();
config.put(OIDCAttributeMapperHelper.TOKEN_CLAIM_NAME, hardcodedName);
config.put(CLAIM_VALUE, hardcodedValue);
config.put(OIDCAttributeMapperHelper.JSON_TYPE, claimType);
if (accessToken)
config.put(OIDCAttributeMapperHelper.INCLUDE_IN_ACCESS_TOKEN, "true");
if (idToken)
config.put(OIDCAttributeMapperHelper.INCLUDE_IN_ID_TOKEN, "true");
mapper.setConfig(config);
return mapper;
}
use of org.keycloak.models.ProtocolMapperModel in project keycloak by keycloak.
the class OIDCAttributeMapperHelper method createClaimMapper.
public static ProtocolMapperModel createClaimMapper(String name, String userAttribute, String tokenClaimName, String claimType, boolean accessToken, boolean idToken, boolean userinfo, String mapperId) {
ProtocolMapperModel mapper = new ProtocolMapperModel();
mapper.setName(name);
mapper.setProtocolMapper(mapperId);
mapper.setProtocol(OIDCLoginProtocol.LOGIN_PROTOCOL);
Map<String, String> config = new HashMap<>();
config.put(ProtocolMapperUtils.USER_ATTRIBUTE, userAttribute);
config.put(TOKEN_CLAIM_NAME, tokenClaimName);
config.put(JSON_TYPE, claimType);
if (accessToken)
config.put(INCLUDE_IN_ACCESS_TOKEN, "true");
if (idToken)
config.put(INCLUDE_IN_ID_TOKEN, "true");
if (userinfo)
config.put(INCLUDE_IN_USERINFO, "true");
mapper.setConfig(config);
return mapper;
}
use of org.keycloak.models.ProtocolMapperModel in project keycloak by keycloak.
the class AllowedWebOriginsProtocolMapper method createClaimMapper.
public static ProtocolMapperModel createClaimMapper(String name) {
ProtocolMapperModel mapper = new ProtocolMapperModel();
mapper.setName(name);
mapper.setProtocolMapper(PROVIDER_ID);
mapper.setProtocol(OIDCLoginProtocol.LOGIN_PROTOCOL);
mapper.setConfig(Collections.emptyMap());
return mapper;
}
use of org.keycloak.models.ProtocolMapperModel in project keycloak by keycloak.
the class AudienceResolveProtocolMapper method createClaimMapper.
public static ProtocolMapperModel createClaimMapper(String name) {
ProtocolMapperModel mapper = new ProtocolMapperModel();
mapper.setName(name);
mapper.setProtocolMapper(PROVIDER_ID);
mapper.setProtocol(OIDCLoginProtocol.LOGIN_PROTOCOL);
mapper.setConfig(Collections.emptyMap());
return mapper;
}
use of org.keycloak.models.ProtocolMapperModel in project keycloak by keycloak.
the class GroupMembershipMapper method create.
public static ProtocolMapperModel create(String name, String tokenClaimName, boolean consentRequired, String consentText, boolean accessToken, boolean idToken) {
ProtocolMapperModel mapper = new ProtocolMapperModel();
mapper.setName(name);
mapper.setProtocolMapper(PROVIDER_ID);
mapper.setProtocol(OIDCLoginProtocol.LOGIN_PROTOCOL);
Map<String, String> config = new HashMap<String, String>();
config.put(OIDCAttributeMapperHelper.TOKEN_CLAIM_NAME, tokenClaimName);
if (accessToken)
config.put(OIDCAttributeMapperHelper.INCLUDE_IN_ACCESS_TOKEN, "true");
if (idToken)
config.put(OIDCAttributeMapperHelper.INCLUDE_IN_ID_TOKEN, "true");
mapper.setConfig(config);
return mapper;
}
Aggregations