Get user email in claims with saml
-
Hi,
I m using FusionAuth with SAML and Azure AD.
In my project .net, I use the api oauth2/token to get a token with a code given by the redirect url in front.
In this token, I have claims but I would like to have the userEmail from azure ad.
How do that please? -
@bartetlau Have you had a chance to check out FusionAuth Lambdas? Specifically, SAML v2 Populate Lambda? Does that get you what you need?
-
Hi,
Thank you for your reply,
I created a lambda very simple:
// Using the samlResponse, reconcile the User and User Registration.
function reconcile(user, registration, samlResponse) {
console.debug("Lambda Start");
user.data = user.data || {};
user.data.country = "France";
console.log('Lambda finish!');
}Assigned to the good identity but finaly user.data is void and I don't have log events or debug envents.
I don't know if it's running.Thanks,
-
What kind of Lambda did you create? Did you assign the Lamba to the application?
If it was SAML V2 Poulate then make sure it is assigned to your application.
Applications -> {Your Application} -> SAML tab -> Authentication response -> Populate Lambda -> {Choose the lambda you created}
Also make sure you have Debug enabled set on the Lambda.
Let me know if this helps.
-
It's a Reconcile assigned to a saml identity provider but I have nothing in event log, the Debug mode is activated.
You can see my screenshots.
-
@laurent-bartet Since it is a SAML reconcile lambda, do you have it assigned to the Identity Provider?
Settings -> Identity Providers -> {Your SAML v2 Identity Provider} -> Edit -> Reconcile Lambda