My Attributes:

    {"Contact.Account", "001230942830"},
    {"Contact.Email", "theEmail@gmail.com"},
    {"Contact.FirstName", "theFirstName"},
    {"Contact.LastName", "theLastName"},
    {"User.Email", "theEmail@gmail.com"},
    {"User.UserName", "theEmail@gmail.com"},
    {"User.FirstName", "theFirstName"},
    {"User.LastName", "theLastName"},
    {"User.Alias", "theAlias"},
    {"User.ProfileId", _profileID}

I can provision a Community user with with a ProfileID, let's say: 00eC0000001GXivIAG.

Why is it that I cannot update the ProfileID to, say, 00e1A00000192sEQAQ, in a another SAML Assertion?

It still logs in correctly, but the profile remains the same.


After going another route and trying to create my own custom JIT handler, I came across a section in the template JIT code that says you can't update certain fields on the User when also attempting to update fields on Contact or Account.

 * If you are updating Contact or Account object fields, you cannot update the following User fields at the same time.
 * If your identity provider sends these User fields as attributes along with Contact 
 * or Account fields, you must modify the logic in this class to update either these 
 * User fields or the Contact and Account fields.
if(attributes.containsKey('User.IsActive')) {
  String IsActiveVal = attributes.get('User.IsActive');
  u.IsActive = '1'.equals(IsActiveVal) || Boolean.valueOf(IsActiveVal);
if(attributes.containsKey('User.ForecastEnabled')) {
  String ForecastEnabledVal = attributes.get('User.ForecastEnabled');
  u.ForecastEnabled = '1'.equals(ForecastEnabledVal) || Boolean.valueOf(ForecastEnabledVal);
if(attributes.containsKey('User.ProfileId')) {
  String profileId = attributes.get('User.ProfileId');
  Profile p = [SELECT Id FROM Profile WHERE Id=:profileId];
  u.ProfileId = p.Id;
if(attributes.containsKey('User.UserRoleId')) {
  String userRole = attributes.get('User.UserRoleId');
  UserRole r = [SELECT Id FROM UserRole WHERE Id=:userRole];
  u.UserRoleId = r.Id;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.