I can verify the user by getting an accessToken back from Facebook once they've approved. I can then find the member by looking them up via their Facebook ID.
However I'm just struggling to see how I can actually Authenticate (log them in) as an Umbraco member as I still lack a password and the only member authentication method I can find is Login(username, password)
My idea is to extend member profile with 2 proprierties: social network id and token.
So the user can associate social login from its private area and so memorize id and token in these fields.
When he login with oauth, if ok we need to check wich member has social id / token and then authorize the logon passing login and password. The password is retrieved by Umbraco membership service.
Except the user Password retrieved from the member service is a hash, not the actual plain text password. You can disable this so that the passwords are stored as plain text but then you are compromising on security.
Yes, this is what worked for me but unfortunately I do not have access to the code that I used. It was in a project for a previous company.
However the concept is solid. I extended the member document to include a Facebook User Id. Once they've authenticated with Facebook, the first thing I do is query my members for that Facebook Id. If it exists then they are a returning user so just log them in by setting the AuthCookie with SetAuthCookie(email, true)
If the Facebook user Id doesn't exist, then they are either a completely new customer, or this is their first time logging in with Facebook so they would need to link to the existing account.
U7.3.1 - UmbracoIdentity: How to associate a "OAuth/social" login to an already register member?
U7.3.1 - How to associate a "OAuth/social" login to an already registered member?
That is: a registered member can after associate its "social" login so he can login with normal login or social.
The documentation on this new feature is more sparse. Is there a better doc / help for the Umbraco community?
I'm currently working on a similar concept.
I can verify the user by getting an accessToken back from Facebook once they've approved. I can then find the member by looking them up via their Facebook ID.
However I'm just struggling to see how I can actually Authenticate (log them in) as an Umbraco member as I still lack a password and the only member authentication method I can find is Login(username, password)
https://our.umbraco.org/forum/developers/extending-umbraco/73276-authenticating-member-via-facebook-login
My idea is to extend member profile with 2 proprierties: social network id and token. So the user can associate social login from its private area and so memorize id and token in these fields. When he login with oauth, if ok we need to check wich member has social id / token and then authorize the logon passing login and password. The password is retrieved by Umbraco membership service.
That was what I thought,
Except the user Password retrieved from the member service is a hash, not the actual plain text password. You can disable this so that the passwords are stored as plain text but then you are compromising on security.
Maybe here the solution: https://our.umbraco.org/forum/umbraco-7/using-umbraco-7/63960-Create-member-then-login-programmatically#comment-215909
Uhm...How to? Any help from Umbraco team?
Certainly looks like the ticket! Will test and report back tomorrow.
Hi, Any updates?
EDIT I actually posted a full example on another thread: https://our.umbraco.org/forum/developers/extending-umbraco/73276-authenticating-member-via-facebook-login
Yes, this is what worked for me but unfortunately I do not have access to the code that I used. It was in a project for a previous company.
However the concept is solid. I extended the member document to include a Facebook User Id. Once they've authenticated with Facebook, the first thing I do is query my members for that Facebook Id. If it exists then they are a returning user so just log them in by setting the AuthCookie with SetAuthCookie(email, true)
If the Facebook user Id doesn't exist, then they are either a completely new customer, or this is their first time logging in with Facebook so they would need to link to the existing account.
How to auth with Facebook? Do you use Skybrud lib?
Follow this discussion too...
https://our.umbraco.org/forum/developers/api-questions/73302-member-login-programmatically-logon-how-to#comment-235017
is working on a reply...