Login only once



i created a twitter app, i need it to only ask user to login/authenticate his account once, the first time only.
cause no user loves to login his credentials every time he uses an app


Yes - so implement the login with Twitter flow, and store the user token and secret after the user has authenticated. You can then re-use those values to operate on the user’s behalf until or unless the user revokes access to your app.


i get invalid access token

object(yii\authclient\OAuthToken)#121 (5) {
string(11) “oauth_token”
string(18) “oauth_token_secret”
array(5) {
string(50) “xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx”
string(45) “xxxxxxxxxxxxxxxxxxxxxxxxxx”
string(10) “xxxxxxxx”
string(15) “xxxxxxxxxxxxxxxxxx”
string(1) “0”

i save both oauth_token and oauth_token_secret, when i send api call with access_token = oauth_token and access_token_secret = oauth_token_secret, i get invalid access token

$user_data = $client_new->api(“account/verify_credentials.json”, ‘GET’, [‘consumer_key’ => Yii::$app->params[‘consumerKey’], ‘consumer_secret’ => Yii::$app->params[‘consumerSecret’], ‘access_token’ => Yii::$app->params[‘accessToken’], ‘access_token_secret’ => Yii::$app->params[‘accessTokenSecret’]]);


any help ?!