use of gov.ca.cwds.service.scripts.IdentityMappingScript in project perry by ca-cwds.
the class IdentityMappingService method map.
public String map(UniversalUserToken subject, String providerId) {
IdentityMappingScript mappingScript = loadMappingScriptForServiceProvider(providerId);
if (mappingScript != null) {
UserAuthorization authorization = userAuthorizationService.find(subject.getUserId());
subject.setAuthorization(authorization);
try {
return mappingScript.map(subject);
} catch (ScriptException e) {
throw new IllegalArgumentException("Identity Mapping failed for service provider: " + providerId, e);
}
}
return subject.getUserId();
}
Aggregations