Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
As the topic title says, I'm trying to create a member and then login programmatically.It would seem that when I call the ValidateUser function it can't login the newly created member and always returns false. The reason I'm trying to do this is because we currently authenticate via an external service - I then create a one time member login that get's deleted once the session ends.
Any help is greatly appreciated - code snippet below.
var memberService = Services.MemberService;
//create umbraco member and set the password as a random Guid
var member = CreateUmbracoMember();
if (Membership.ValidateUser(member.Username, member.RawPasswordValue))
//Always returns false
You can login a member programmatically by doing the following:
That did the job, thanks!
Glad I could help. Can you please mark a post as the solution.
On a SurfaceController there is also the property Members which represents an instance of Umbraco.Web.Security.MembershipHelper
// Do what you want.
this is for the password in clear mode.
How solve for hashed password?
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted