Hi @apd,
Welcome to the Community!
You can prevent user profile attributes from being stored by following the documentation here: https://auth0.com/docs/security/denylist-user-attributes
If this looks like what you are looking for, here are some steps to implement the user attribute deny list:
First, you’ll need an Management API Access Token that has the update:connections
and read:connections
scopes.
You can follow the guide for manually obtaining an access token: Get Management API Access Tokens for Testing
Next, you can get data for all of your connections using the /api/v2/connections endpoint. You’ll need the IDs and options
object for each connection.
Finally, update each connection’s options
object. Note: when you update the options
object it will override what you currently have set, so be sure to add to the options objects that you collected from the GET endpoint.
The body of the request will look like this:
{
"options":{
// Any exiting options properties for the connection
"non_persistent_attrs": ["email", "name", "email_verified", "family_name", "gender", "given_name",
"picture", "nickname", "locale"]
}
}
As the guide mentions, the user’s information is still in the rule, so if you’d like to send some non-persistent user data in the ID Token, it should be available. However, if you are not getting the user data you need, you can add Custom Claims to the ID Token to a Rule:
function (user, context, callback) {
const namespace = 'https://YOUR_APP_URL';
let idTokenClaims = context.idToken || {};
idTokenClaims[`${namespace}/email`] = user.email;
context.idToken = idTokenClaims;
callback(null, user, context);
}
Here is additional documentation related to Auth0 and GDPR compliance: Auth0 General Data Protection Regulation Compliance