Notifications
Announcements
No record found.
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
Hi Evan,
The password isn't actually encrypted, it's hashed, and stored in the adx_identity_passwordhash field on the contact. That one field contains both the hash and the salt needed to verify a password.
The Portal uses ASP.NET Identity (v2) for local authentication, and so leverages its default password hashing functionality.
This StackOverflow thread has more details on the password hashing:
stackoverflow.com/.../asp-net-identity-default-password-hasher-how-does-it-work-and-is-it-secure
If you're going to create the hash yourself, make sure you'll also creating a random security stamp (adx_identity_securitystamp) - authentication won't work if that field isn't set properly. Typically it's set to a random GUID.
Hope that helps.
Nick
I agree with Nicholas Hayduk
If you dont want to develop ASP.NET Identity Password Hasher, then there is an alternative way you could to try by using existing CRM Portal functionality. Have a look on "Change Password" dialog in the Portal solution installed CRM. Which is used to change Portal password. Following are key element ( Custom Workflow) using to change password.
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
Workaround
Thanks
Justin Jose
Thank you Justin Jose and Nicholas Hayduk.
I want to using Justin Jose's Workaround.
I can find the processes "Change Password", But, I don't know how to using plugin to invoke this processes.
And, I will import lot's of members to contact, Does the processes support ?
Did you install CRM Portal? Its a Dialog called "Change Password".
1. Create new workflow using following custom workflow. Have a look sample "Change Password" Dialog
2. Pass the password to the workflow using Action and Plugin.
Or
If you don,t want to set custom password, then you could use 'Redeem Invitation'. This can be configured on creation contact.
Hi Justin,
I want to use plug in to monitor contact create by import members. When contact created, the plug in will automation generation an portal login id and password for it. Because of password is an hash value, So, I want to use the CRM change Password method(Because, I don't know, Is the password hash value replaced by others encryption in the future), So, I want to do in bellow:
1. Using plug in to monitor contact create.
2. Using Plug in invoke CRM "Change Password" processes(Settings --> Customization --> Customize the System --> Processes -->"Change Password").
If the Plug in can not invoke CRM "Change Password" processes, Is there only one way to setting password hash value?
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?
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
3. Invoke Action using plugin
4. Pass the password to Action
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.Parameters.Add("Password", "");
response = service.Execute(request) as ExecuteWorkflowResponse;
}
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.
I'm create an workflow, and add steps using Adxstudio.Xrm.Workflow.Identity (1.0.0.2):Adxstudio.Xrm.Workflow.Identity.ChangePassword
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.
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
SA-08121319-0 4
Calum MacFarlane 4
Alex Fun Wei Jie 2