jreed
March 3, 2020, 4:37pm
1
I have SAML connection and when it comes in the Email is not marked as verified. I saw this other question that says I should be able to do it via rules:
Hi
I want to use the link account rule as is - problem is that one of the conditions are that the email was verified , but for saml connection users emails are never verified.
yes i know i can change the rule - but i thought it make more sense to say
hey - someone already verified them , this is why i have a trust with them
so how can i change user profile upon login to be email_verified only for saml connections or social
thanks
Shlomi
But it seems like email_verified doesn’t get set via rules:
function (user, context, callback) {
user. email_verify = true;
user.email_verified = true;
callback(null, user, context);
}
^-- with that code I see that the email_verify
does get set properly, but email_verified
does not get updated to true. Is it a special case I need to edit in a different way?
1 Like
Hi @jreed ,
Welcome to the Community
Please see below documentation to update user at auth0
The question is if it’s possible to update the user.email_verified
property using Rules.
For some reasons you can update user.nickname
or user.email
using javascript rules, but not user.email_verified
.
I could not find any answer to this in documentation you referenced.
Hi All, Apology for delay in response:
You can set this field value in rule by calling patch API. See below code for reference:
function (user, context, callback) {
const request = require('request');
const userApiUrl = auth0.baseUrl + '/users/';
//Your baseURL will be like this https://tenantName.domain-name.auth0.com/api/v2
// Set email verified if a user has already updated his/her password
request.patch({
url: userApiUrl + user.user_id,
headers: {
Authorization: 'Bearer ' + auth0.accessToken
},
json: { email_verified: true },
timeout: 5000
},
function(err, response, body) {
// return in case of success
return callback(null, user, context);
});
}
2 Likes
As @rashid779939 said.
And the documentation for this is at Auth0 Management API v2
Update a user.
These are the attributes that can be updated at the root level:
…
email_verified
…
system
Closed
March 23, 2020, 9:19am
6
This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.