Last post Oct 06, 2016 11:48 PM by KathyW
Sep 22, 2016 01:53 AM|asplearning|LINK
Hello everyone, I have a question about registering users on my site. I have a sign up page that I allow user to sign up. I would like to allow the user sign up using their facebook account. But my question is with the password. So how am I supposed to set
it up? I don't think facebook will allowed app to access user password for obvious reasons. But now they sign up and come to my site, put in their email, but how about password?
One solution that comes to my mind is to generate a random password to send to their email and asked them to change it. But is this a good solution? Any suggestion on how to implement this?
Sep 22, 2016 02:35 AM|KathyW|LINK
Facebook has instructions and code for you.
Sep 22, 2016 02:58 AM|asplearning|LINK
Thanks, yes I found that article too. My question is how I can set up the password for the user and insert it into my own database if they register using facebook account.
Sep 22, 2016 04:56 PM|KathyW|LINK
You wouldn't have or store the password. They are logging in through facebook, and the password is used at facebook. Have you tried implementing it? Read the documentation on getting the facebook userid, access tokens, etc. But the short answer is:
this is separate from registering directly on your site. You'd have their facebook id and the current visit's accessToken created by facebook.
Sep 22, 2016 10:10 PM|asplearning|LINK
Thank you for your reply. I am not trying to develop login functionality which only requires authentication. But this is for registration. After the registration, they can do some work on my site which will require user ID. All I want is this: After login
with facebook account, I want to create this user with their first name, last name and password and insert them into the database.
First name and last name are easy to get but I have problems with password.
Sep 23, 2016 05:14 AM|KathyW|LINK
You are missing my point. You cannot get the facebook password. When someone logs in with facebook, the password processing is done via facebook, not your site. You have access to the facebook user id, and the current access token that facebook will
send you, not their facebook password. Why do you want the password? You will not be using it. You can track them with the facebook user id, which won't change when they login again via facebook.
Sep 23, 2016 06:47 AM|shivanand G N|LINK
Hi, Refer the below link.
Sep 26, 2016 04:42 AM|Yohann Lu|LINK
From your description, you can't get the Facebook password. When you register with an external login provider, you do not have a password registered with the app, it is dependent on the external login provider.
Enabling authentication using Facebook, Google and other external providers:
Sep 29, 2016 09:04 PM|asplearning|LINK
Thanks for your reply. No I don't want their password. My question is what is the best solution when it comes to dealing with the password column in my database table as I mentioned, I can't access their password and I don't want their password. One way
I can overcome this is to generate a random password and send it to their email and they can use that password to login.
Is there a better solution rather than the one I mentioned about the random password?
Hope it makes sense.
Sep 30, 2016 03:52 AM|KathyW|LINK
Don't put a password in that table for users that sign up with social media. You don't need one, they don't need one, your database doesn't need one. They will not be using that password to log on. They will be using their social media account to log
If you don't intend people to use their social media accounts to log on, don't offer that option. If you do offer it, the only people who will need a password in your database are people who do not use a social media option and create an account directly
with your site.
Oct 06, 2016 10:20 AM|asplearning|LINK
Thank you KathyW for your reply. I am sorry. Perhaps I didn't make it clear. It's NOT about loggin on or logging in at all. It's about signing up a new account with my site. My sign up page is very simple. I need only email, first name and last name, which
I can access through the facebook API. Anyway, I found a design that may suit my need. After they login with their page account, I may need to redirect them to a page that they can set up their password.
Oct 06, 2016 11:48 PM|KathyW|LINK
Anyone using your site will be very confused if they sign in using Facebook, then are asked for a completely different login password. Why, they will ask, did I sign in using Facebook? The whole point of that feature is to not need another username and
password for a site.