You are viewing limited content. For full access, please sign in.

Question

Question

Require LFDS user password reset through Workflow

asked on May 11, 2021

I am looking to have a LFDS user to reset their password when logging into Web Link. I am using the following code when creating the user and would like to have them reset the password.

' Is the user already created?
Dim LFDSUser As LaserficheUser = LaserficheUser.Create(db)

' Need to create the user.
LFDSUser.ContainerID = GetOrganizationbyName(sOrganizationName, db)
LFDSUser.MfaRequired = False
LFDSUser.Name = sUsername
LFDSUser.Password = sPassword
LFDSUser.PasswordUsesLeft = 0
LFDSUser.Enabled = True
LFDSUser.Register()

I was thinking that the PasswordUsesLeft set to 0 would kick off that process. I also tried 1, but that also did not work. Is the PasswordUsesLeft the right variable to be using? If so, what should I set it to? If not, where do I set it so that the user would reset their password?

0 0

Answer

SELECTED ANSWER
replied on May 11, 2021

Figured it out...

' Is the user already created?
Dim LFDSUser As LaserficheUser = LaserficheUser.Create(db)

' Need to create the user.
LFDSUser.ContainerID = GetOrganizationbyName(sOrganizationName, db)
LFDSUser.MfaRequired = False
LFDSUser.Name = sUsername
LFDSUser.Password = sPassword
LFDSUser.PasswordUsesLeft = 1
LFDSUser.Enabled = True
LFDSUser.Register()
LFDSUser.Password = sPassword
LFDSUser.PasswordUsesLeft = 1
LFDSUser.Update()

Not sure why, but the above code works where leaving off the last three lines did not.

1 0
replied on May 12, 2021

From what I understand you have to Register the user before you can set the password expiration and certain other values like email address.

This is how I did it in my code.

                // register user
                newuser.Register();

                // set claim attributes
                var claims = newuser.GetClaims();
                claims.SetClaim(ClaimTypes.Email, new string[] { email });
                newuser.SetClaims(claims);

                // save user
                newuser.PasswordUsesLeft = 0;
                newuser.Update();

 

0 0

Replies

You are not allowed to reply in this post.
You are not allowed to follow up in this post.

Sign in to reply to this post.