Twitter oauth skip Allow connection for existing users screen

I successfully allowed users to connect to my web application using twitter oauth. And I can insert user information after login.

My problem is that existing users are always redirected to the Allow / Deny application screen on Twitter every time they click on the Twitter login.

How can I skip this step for my existing users so that they don’t have to click the "Allow" button every time they log in?

I use this library: http://www.haughin.com/code/twitter/

thanks.

+4
source share
2 answers

This is done using Twitter feed login . Instead of sending users https://api.twitter.com/oauth/ authorization ? Oauth_token = xyz send them https://api.twitter.com/oauth/ authenticate ? oauth_token = xyz. In this case, if the user has previously authorized your application and has already authenticated with twitter.com, they will be automatically redirected back to your application without requesting permission to access them.

+3
source

When a user allows your application to use their Twitter account, Twitter gives you two tokens: OAuthToken and OAuthTokenSecret.

Saves these tokens in a cookie or settings file or something else.

Then, the next time you need to make a Twitter request on behalf of this user, you use these tokens.

-1
source

Source: https://habr.com/ru/post/1348172/


All Articles