Using Twitter api logout on Twitter? - twitter

User login my application with oauth, after logout my application but twitter can't do, problem is user twitter account is active.
when that logout my application at the same time logout twitter
twitter api not support this action?

No, the twitter API will not log your users out of twitter.
account/end_session only ends the current API Session. I'm working on an site that requires users to be able to log out and then log back in again with another twitter account. To do that, you have to store multiple access tokens per user and establish one as the current access token. More info in the link below.
http://groups.google.com/group/twitter-development-talk/browse_thread/thread/02e44b27d7ba3661?pli=1
As far as signing out of twitter, it's up to the user to sign into twitter and sign out themselves, which is not ideal if working on a shared computer.

Twitter just closing the session at api ,not close the session on Twitter :)

You'll have to call account/end_session to end the session of the authenticated user on twitter.

Old thread agreed, I just integrated Twitter login in my android app using Fabric. I found the following method
com.twitter.sdk.android.Twitter.logOut
I guess they have implemented it now! I couldn't find any documentation, honestly I've not put too much time into it. But I think logout means what I think it means :)

Twitter does not have api for logout. You can use the session closing api to end the user session.

You can use oauth/authenticate or oauth/authorize and add "force_login=true" parameter. This will prompt the user with a login form.
view this thread

Related

How to know user has already done Facebook login at iOS app

I am developing iOS App which use Facebook iOS SDK 4.
When user has already done Facebook login, by doing Facebook login the dialog which shows "user has already approved your app" had be displayed.
So, do not show the dialog. I want to know whether the user has already done Facebook login.
Anyone know the good way? I think accessToken is returned if user once had done Facebook login.
FBSDKAccessToken manage current logged user's accessToken.
According to official Facebook Login guide
"FBSDKAccessToken Represents the access token provided by a successful login. Most important, it provides a global +currentAccessToken to represent the currently logged in user."
The currentAccessToken is a convenient representation of the token of the current user and is used by other SDK components (like FBSDKLoginManager).
According to above you can check either user has valid accessToken or not and based on this you can track call login method otherwise just skip to next flow.
In Facebook the access tokens are per user so you can pass them around apps and they will work. In your case if you can ship an access token from another app you will be able to skip the next logging in and use the API normally.
However I think this this thread will help you.
Things are a little bit different with iOS cause I have done a facebook login on Android and got no such issues.

Can we get email Id from Facebook application?

Can an application check if anybody is logged into Facebook application in mobile ,if logged in get the user email Id from that and use it in their application?
To get a logged in users email address, you would have to authenticate with the API and the user would have to approve you using the Oauth workflow.
You can display a customized login / connect button using the Facebook API but if I recall correctly, that is an iframe that is embedded in your page, and you never see the email from that.
tldr; No. You need to authenticate using the Oauth workflow and have the user grant you permission.
First you have to authenticate user and then you can get logged in user profile information. For that you have to use Facebook API. Please check below link.
https://developers.facebook.com/docs/facebook-login/ios/v2.2

How can I force re-authentication with the Windows Live OAuth API?

Is there a parameter I can pass to https://oauth.live.com/authorize that will force the user to login again?
The problem is if the user is logged in, it will redirect transparently back to my site, even if the user wants to use a different Windows Live account.
Twitter's OAuth API accepts "force_redirect=true", and Facebook accepts "auth_type=reauthenticate", but I can't find one for Windows Live.
First redirect your user to:
https://login.live.com/oauth20_logout.srf?client_id={$Client_Id}&redirect_uri={$Redirect_URI}
It will log him off and then continue your coding !

How can I force login with the OAuth API?

Is there a parameter I can pass to https://www.facebook.com/dialog/oauth that will force the user to login again?
The problem is if the user is logged into Facebook, it will redirect transparently back to my site, even if the user wants to use a different Facebook account.
Twitter's OAuth API accepts a "force_redirect=true" parameter which does what I want, but I can't find one for Facebook.
I think "auth_type=reauthenticate" is the option you are looking for.
Docs: https://developers.facebook.com/docs/reauthentication/

Twitter JS API - get current logged in user

I am using twitter #anywhere JS API in my application and don't know how to use their methods and properly execute them. At present, I am following this docs for the API.
I am working on a scenario where, I need to check from my app, if any twitter user is logged in on the same browser, get the current twitter user details and cross check with my app for the twitter user. If the user exists in my app, automatically login the user. (more importantly it should not ask the user to connect to the twitter app. Without asking the credentials I need to get the currentUser)
NOTE: Facebook already supports this type of method. We can get the facebook loggedin user session from getSession() method.
Is there anyone there to help me out on this one?

Resources