Skip to content

Instantly share code, notes, and snippets.

@nov
Created March 23, 2017 04:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nov/be7df5ec71d7eeb93063d2300f28ab90 to your computer and use it in GitHub Desktop.
Save nov/be7df5ec71d7eeb93063d2300f28ab90 to your computer and use it in GitHub Desktop.
public class OIDCRegHandler implements Auth.RegistrationHandler{
public User createUser(Id portalId, Auth.UserData data){
List<User> users = [SELECT Id FROM User WHERE FederationIdentifier =:data.identifier];
if (users.size() == 1) {
return users[0];
} else {
return null;
}
}
public void updateUser(Id userId, Id portalId, Auth.UserData data) {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment