Skip to content

Adds new script-based mapper functionality with native functions for aws lambda

License

Notifications You must be signed in to change notification settings

winnin/keycloak-plugin-mapper-aws-lambda

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Keycloack mapper plugin: Implements native AWS methods for script

Adds new script-based mapper functionality with native functions for aws lambda

alt text

Instalation

docker cp keycloak-mapper-aws-lambda-script-2.0.jar keycloack:/opt/jboss/keycloak/standalone/deployments/

Code example

/**
 * Available variables: 
 * user - the current user
 * realm - the current realm
 * token - the current token
 * userSession - the current userSession
 * keycloakSession - the current keycloakSession
 * lambda - the lambda instance from aws
 */

var email = user.getFirstAttribute("email");

var inputJSON = JSON.stringify({ email: email });

var result = lambda.invoke("function-name", inputJSON);

var resultObject = JSON.parse(result);

exports = resultObject;

Reference

https://github.com/keycloak/keycloak/blob/main/services/src/main/java/org/keycloak/protocol/oidc/mappers/ScriptBasedOIDCProtocolMapper.java

About

Adds new script-based mapper functionality with native functions for aws lambda

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages