In my application, user can login facebook and share my application details. it's work's fine. but when user have a official facebook application and if user is login through that official application or after not log out or start my application and when click on that facebook login, user can automatic login to that facebook login id and password. but i need that in my application user again put user name and their password. how can i do this. please assist me. thank you.
Asked
Active
Viewed 465 times
2 Answers
3
Short answer:
You can't.
Long answer:
Facebook has created SSO (Single Sign On) for the explicit reason of making authentication easy for third-party app users. Not to mention, keeping the actual authentication secure.
To get a User to authenticate with Facebook from a third-party application, there are 3 ways. Technically, 2 ways, but the third is to disable SSO and force a browser based application.
- If the User does not have the Facebook Application installed on his device, a Web Page will do the authentication duties.
- If the User has the Facebook Application installed on the device, the authentication will be done via SSO.
- This last one is used by some developers. This is achieved by using
FORCE_DIALOG_AUTHintead of DEFAULT_AUTH_ACTIVITY_CODE where you are doing the authentication part in your app. But this is not recommended as it may open up your app to malicious apps that can steal your user's Facebook credentials (SOURCE: Answer by Jesse Chen, who works at Facebook. https://stackoverflow.com/a/12433933/450534. If you would still like to use it
Bottom line is, you cannot have a user authenticate from your application. You will need to do it using the Facebook way.
Community
- 1
- 1
Siddharth Lele
- 27,623
- 15
- 98
- 151
3
Use this in Facebook authentication method
private void authenticate() {
mFacebook.authorize(this, permissions, Facebook.FORCE_DIALOG_AUTH,
new DialogListener(){
This will help you.
Pang
- 9,564
- 146
- 81
- 122
Nilesh Verma
- 914
- 1
- 11
- 26