Last post Oct 03, 2016 08:49 AM by Dmitry Sikorsky
Oct 03, 2016 07:09 AM|gauravpalgayatri|LINK
I want to know how can i login with Facebook and save credentials details in my database for doing further processing in my website.
Currently i am using some code but in with i am only getting my Facebook Photo and Id only but not getting email and password details form the facebook account.
Oct 03, 2016 07:46 AM|Dmitry Sikorsky|LINK
It is NOT possible to get password from the Facebook. It is possible to get emails as I know, but it required additional approval from the user. Why you want to get the password? You should consider Facebook only as identity provider. If Facebook tells that
user A is user A it just trust it and that's all. The next time user A login you can be sure that it is still the same user A.
Oct 03, 2016 08:17 AM|gauravpalgayatri|LINK
basically in my site i have 2 options for signup and signin first is basic form option in which user can provide there details and signup and 2nd option is login through facebook.
Through my login process i am able to get the login id and save it to database and when i am login then first authenticate login credentials through my database and taking the login id in session and using this id for doing further tasks through this id
and insert data in my database like upload file through my login id.
But when i am login with facebook i am not able to do further task in my site becoz i don't have an login id for doing further process.
Oct 03, 2016 08:28 AM|Dmitry Sikorsky|LINK
Are you using Identity or custom implementation of Facebook login?
Anyway, the central part is User. User has id. All data related to user had UserId property. For example, user creates some content and that content has relation to the user by UserId.
User may have different login methods:
Usually I create additional entity - Credential. So each user may have different credentials. Each credential has UserId property. If you login by facebook, you get facebookId from the Facebook and trying to get your local Credential with such facebookId.
If you get one, look at its UserId property and you can get the user. The same as email and password. When login using email and password I look for the credential with such email and password (hash) and if find one, take its UserId.
You can just use Microsoft Identity - it is fixed there from the box.
Oct 03, 2016 08:43 AM|gauravpalgayatri|LINK
Sir, i think you are understanding my problem properly. Please elaborate how can i get facebookId from the Facebook and how can i trying to get from my local Credential with such facebookId.
Oct 03, 2016 08:49 AM|Dmitry Sikorsky|LINK
Here you can find detailed explanation and tutorial:
On the bottom of the page you can find the link to enabling of Facebook login etc: