matrix-org / synapse

Synapse: Matrix homeserver written in Python/Twisted.
https://matrix-org.github.io/synapse
Apache License 2.0
11.83k stars 2.12k forks source link

Outdated Auth0 OIDC Docs #16753

Open craigmassie opened 11 months ago

craigmassie commented 11 months ago

Description:

The current docs for using Auth0 (snippet below) suggest using Rules to set user attributes, but Rules is being deprecated in favour of Actions. Docs on the migration can be found here.

New Auth0 users are unable to follow the docs as they are unable to create Rules. Existing users aren't yet affected.

function addPersistenceAttribute(user, context, callback) {
  user.user_metadata = user.user_metadata || {};
  user.user_metadata.preferred_username = user.user_metadata.preferred_username || user.user_id;
  context.idToken.preferred_username = user.user_metadata.preferred_username;

  auth0.users.updateUserMetadata(user.user_id, user.user_metadata)
    .then(function(){
        callback(null, user, context);
    })
    .catch(function(err){
        callback(err);
    });
}