If your code is in a macro partial view or controller or class inheriting from one of the special Umbraco base controllers / classes eg SurfaceController
Then you will have access to the MembershipHelper helpers via the Members instance.
I'll try...I need to logon the user because he logon with social network before. I explain better.
1 - the admin register the user
2 - after the user can choose to enable the login with social network so I need to create a Wizard to memorize social network ID + token.
3 - after he can login or with social or normal
Member login: programmatically logon. How to?
How to login a member via API that is passing login and password ( hashed ) via code and not input from user?
Hi Biagio
If your code is in a macro partial view or controller or class inheriting from one of the special Umbraco base controllers / classes eg SurfaceController
Then you will have access to the MembershipHelper helpers via the Members instance.
https://our.umbraco.org/documentation/Reference/Querying/MemberShipHelper/
and therefore:
should do it!
If you are in a custom class you can create a reference to the MembershipHelper using:
regards
Marc
Hi, Marc,
Thank you. The problem is if the password is hashed.
Ahh Biagio I see;
So do you need to know, given that you have the hash, how to compare this hash to the entry in the database table ?
or are you pretty much at the stage where you just want to log the person in ?
If so I have a feeling:
or
will create the authentication cookie for the user, and it will be as if they just logged in.
I'll try...I need to logon the user because he logon with social network before. I explain better.
1 - the admin register the user 2 - after the user can choose to enable the login with social network so I need to create a Wizard to memorize social network ID + token. 3 - after he can login or with social or normal
Marc was bang on the money, you need to set the AuthCookie session wih:
Once I've tidied my code I'll post a full example
I've detailed the solution in my original question here:
https://our.umbraco.org/forum/developers/extending-umbraco/73276-authenticating-member-via-facebook-login
is working on a reply...