mirror of https://github.com/jacekkow/keycloak-protocol-cas

Updater Bot
2020-05-01 7224325967dae3bccb4a113f4a44da4b5965c56e
commit | author | age
0ad1a9 1 package org.keycloak.protocol.cas.mappers;
MP 2
3 import org.keycloak.models.ProtocolMapperModel;
4 import org.keycloak.protocol.cas.CASLoginProtocol;
5 import org.keycloak.protocol.oidc.mappers.OIDCAttributeMapperHelper;
6
7 import java.util.HashMap;
8 import java.util.Map;
9
10 public class CASAttributeMapperHelper {
11     public static ProtocolMapperModel createClaimMapper(String name,
12                                                         String tokenClaimName, String claimType,
13                                                         String mapperId) {
14         ProtocolMapperModel mapper = new ProtocolMapperModel();
15         mapper.setName(name);
16         mapper.setProtocolMapper(mapperId);
17         mapper.setProtocol(CASLoginProtocol.LOGIN_PROTOCOL);
18         Map<String, String> config = new HashMap<String, String>();
19         config.put(OIDCAttributeMapperHelper.TOKEN_CLAIM_NAME, tokenClaimName);
20         config.put(OIDCAttributeMapperHelper.JSON_TYPE, claimType);
21         mapper.setConfig(config);
22         return mapper;
23     }
24
25 }