Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

The portal user's password encryption type

Posted on by Microsoft Employee

I want to using plugin to automation create portal's login id and password after created an contact. But i don't know the encryption type.

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: The portal user's password encryption type

    Hi Justin,

    I'm only updating the Security Stamp and Password hash (but only the former gets updated). Updating the fields you mentioned, didn't had impact.

    After turning on audit log for password hash I noticed the field gets updated with empty values, somehow the argument "Password" never gets assigned or so it seems, and therefore the hash calculation never happens.

    I still don't know why the argument (Password) isn't passed.

    Capt.PNG

    Thanks

  • Verified answer
    Justinjose Profile Picture
    Justinjose 2,707 on at
    RE: The portal user's password encryption type

    Hi Isidro Goncalves,

    Strange. I have tested and it worked. Do you have same step as in image. Are you updating the Login Enabled, Lockout Enabled fields in the contact in the Action steps.

    OrganizationRequest req = new OrganizationRequest("new_ActionChangePassword");
                req["Password"] = "password";
                req["Target"] = new EntityReference("contact", new Guid("29BB87C2-8C3D-E811-A823-0003FF3917D9"));
    
                //execute the request
                OrganizationResponse response = _orgService.Execute(req);

    Thanks

    Justin Jose

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: The portal user's password encryption type

    Hi Justin,

    my action is the same as your screenshot.

    My action is executed and there're no errors. And although my "Security Stamp"

    gets updated with a new Guid, "Password hash" field remains empty. I'm logged as System Administrator, so I should be able to see the value or at least some stars to indicate the field has data.

    my code:

    var request = new OrganizationRequest("new_changepasswd")

                   {                  

                       ["Target"] = new EntityReference("contact", Guid.Parse("XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX")),

                       ["Password"] = "HelloWorld"

                   };

    Any suggestions ?

  • Verified answer
    Justinjose Profile Picture
    Justinjose 2,707 on at
    RE: The portal user's password encryption type

    Hi  Evan,

    you created some thing like this

    4452.password.PNG

    Thanks

    Justin Jose

  • Justinjose Profile Picture
    Justinjose 2,707 on at
    RE: The portal user's password encryption type

    are you trying to pass the value to Dailog?

    thanks

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: The portal user's password encryption type

    Hi Justin,

    I'm create an workflow,  and add steps using Adxstudio.Xrm.Workflow.Identity (1.0.0.2):Adxstudio.Xrm.Workflow.Identity.ChangePassword

    Adxstudio.Xrm.Workflow.Identity (1.0.0.2):Adxstudio.Xrm.Workflow.Identity.SetSecurityStamp

    But I have another question:

    An error has occurred while trying to start the linked child dialog. The input arguments in the child dialog do not match those of the parent dialog. Contact your system administrator for help.


    7024.2018_2D00_06_2D00_13_5F00_171338.png

     

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: The portal user's password encryption type

    Hi Nicholas,

    I'm not sure the adx_identity_securitystamp field is correct for password.

    Because, I'm changed the password value as same as old password value, the password was been changed,

    But the adx_identity_securitystamp  field value is not change.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: The portal user's password encryption type

    Hi Justin,

    I want to using this method to change password, But, How to set login id and password?

    private void CallingWorkflow(Guid entityId)

           {

               if (entityId == Guid.Empty) return;

               //Adxstudio.Xrm.Workflow.Identity.ChangePassword:3f4a37bf-d77a-4231-adb4-2e12630e44e3

               //Adxstudio.Xrm.Workflow.Identity.SetSecurityStamp:6ad91e81-104d-448d-88fd-b8a3ed832c4a

               ExecuteWorkflowRequest request = new ExecuteWorkflowRequest();

               request.WorkflowId = new Guid("6ad91e81-104d-448d-88fd-b8a3ed832c4a");

               request.EntityId = entityId;

               ExecuteWorkflowResponse response = service.Execute(request) as ExecuteWorkflowResponse;

               request.WorkflowId = new Guid("3f4a37bf-d77a-4231-adb4-2e12630e44e3");

               request.EntityId = entityId;

               request.Parameters.Add("Password", "");

               response = service.Execute(request) as ExecuteWorkflowResponse;

           }

  • Suggested answer
    Justinjose Profile Picture
    Justinjose 2,707 on at
    RE: The portal user's password encryption type

    Hi Evan,

    Please try below.

    1. Create an Action with a string input parameter and call it Password.

    2. Create step in the above Action using Adxstudio.Xrm.Workflow.Identity (1.0.0.2):Adxstudio.Xrm.Workflow.Identity.ChangePassword

    Adxstudio.Xrm.Workflow.Identity (1.0.0.2):Adxstudio.Xrm.Workflow.Identity.SetSecurityStamp

    3. Invoke Action using plugin

    4. Pass the password to Action

    Thanks

    Justin Jose

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: The portal user's password encryption type

    Hi Nicholas

    My code in below:

    [code]

    public string HashPasswordV2()
    {
    string password = textBox3.Text;//Password
    Guid securitystamp = new Guid(textBox1.Text);//Securitystamp 
    byte[] salt;
    byte[] buffer2;
    if (password == null)
    {
    throw new ArgumentNullException("password");
    }
    using (Rfc2898DeriveBytes bytes = new Rfc2898DeriveBytes(password, securitystamp.ToByteArray(), 0x3e8))
    {
    salt = bytes.Salt;
    buffer2 = bytes.GetBytes(0x20);
    }
    byte[] dst = new byte[0x31];
    Buffer.BlockCopy(salt, 0, dst, 1, 0x10);
    Buffer.BlockCopy(buffer2, 0, dst, 0x11, 0x20);
    return Convert.ToBase64String(dst);//Hash Value
    }

    [/code]

     

    I‘m test same as password and securitystamp as portal.
    But the hash value is not equal portal hash value, Could you help me to find out my mistake?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans