access-token

Google API Fatal error: Uncaught LogicException: refresh token must be passed in or set as part of setAccessToken

旧街凉风 提交于 2019-12-02 10:53:51
Working with the PHP Quickstart code, I found a problem: when the token needs to be refreshed, the code returns the following error: Fatal error: Uncaught LogicException: refresh token must be passed in or set as part of setAccessToken in /app/vendor/google/apiclient/src/Google/Client.php:258 Stack trace: #0 /app/gmail.php(32): Google_Client->fetchAccessTokenWithRefreshToken(NULL) #1 /app/test.php(14): getClient() #2 {main} thrown in /app/vendor/google/apiclient/src/Google/Client.php on line 258 I modified the getClient() function like this: function getClient() { $client = new Google_Client()

Facebook Messenger: get access token of linked account

回眸只為那壹抹淺笑 提交于 2019-12-02 08:50:38
First off, I'm not looking for the access token of a facebook account. I (or my facebook messenger bot) need the access token of a linked 3rd party account. The account was successfully linked as described here: https://developers.facebook.com/docs/messenger-platform/identity/account-linking Slightly off topic: The first issue I noticed that does not meet the OIDC/OAuth2 specs is, that the redirect URI given to the /authorize endpoint expects a param " authorization_code " instead of "code" with the actual authorization code . Ok, good thing we do not use off-the-shelf software for the IdP, so

AccountManager: invalidateAuthToken does not invalidate the token

旧城冷巷雨未停 提交于 2019-12-01 22:29:43
问题 I'm trying to get a brand new token from a Google account stored in a Android device but all that I got is the same old token that I've been caching in the last days. It seems that it's cached somewhere in the phone, and even the Internet request is not being sent (I made the test in the app without Internet connection and the same token is returned). I used the invalidateAuthToken method before getting a new one with getResult from AccountManagerFuture . Take a look please: public String

AccountManager: invalidateAuthToken does not invalidate the token

戏子无情 提交于 2019-12-01 21:20:16
I'm trying to get a brand new token from a Google account stored in a Android device but all that I got is the same old token that I've been caching in the last days. It seems that it's cached somewhere in the phone, and even the Internet request is not being sent (I made the test in the app without Internet connection and the same token is returned). I used the invalidateAuthToken method before getting a new one with getResult from AccountManagerFuture . Take a look please: public String updateToken(Activity activity) throws Exception { AccountManager am = AccountManager.get(activity);

Switch user or re authenticate with Instagram

旧街凉风 提交于 2019-12-01 16:10:48
Following the Instagram documentation I'm able to authenticate a user and retrieve an access_token easily But now I want to change of Instagram account which is impossible since the browser automatically call my callback URL because I'm already signed in with an account (there is no login / authorization form again) To explain what happen here is the authenticate / authorization flow : Open a browser asking user to log and authorize User fill up form and submit (this step is skipped when user is already signed in !) Browser redirect to callback URL You see step 2 is skipped so we can't login

Switch user or re authenticate with Instagram

冷暖自知 提交于 2019-12-01 15:08:00
问题 Following the Instagram documentation I'm able to authenticate a user and retrieve an access_token easily But now I want to change of Instagram account which is impossible since the browser automatically call my callback URL because I'm already signed in with an account (there is no login / authorization form again) To explain what happen here is the authenticate / authorization flow : Open a browser asking user to log and authorize User fill up form and submit (this step is skipped when user

How to add a “Authorization=Bearer” header with Indy in Delphi?

北城余情 提交于 2019-12-01 10:58:29
I'm trying to do a POST request using an access_token, and it works fine using POSTMAN, but when I try to do the same request on Delphi, I can't find a way to add the "Authorization=Bearer eyxxxxxx..." to the Request header, as POSTMAN does. POSTMAN Request (working well): POST /somepath HTTP/1.1 Host: someurl.com.br Authorization: Bearer eyJhbGciOiJSUzI1NiJ9..... Content-Type: application/json (body content ommited) Indy Request generated by Delphi, captured by HTTP Analyzer (always returning 401 Forbidden error, because the absence of "Authorization=Bearer" part): POST /somepath HTTP/1.1

Access token immediately invalidated

对着背影说爱祢 提交于 2019-12-01 06:30:17
for a few users (maybe not that few, considering the number of related mails I'm receiving) the access token associated with an OAUTH authorization seems to be immediately invalidated. The user is guided through the usual authorization process, he accepts the permissions, he is redirected to the right page which includes the access token, but as soon as my application tries to use the access token to get the user ID, an error is received instead: {"error":{"message":"Error validating access token: Session has expired at unix time 0. The current unix time is 1323939801.","type":"OAuthException"

Having multiple Twitter instances with twitter4j library.

江枫思渺然 提交于 2019-12-01 04:45:24
I need to be able to make different Twitter instances with same consumer key and secret but different user level access tokens . I have already obtained the access tokens for 10 users based on consumer credentials of my app by using standard Twitter OAuth Sign In protocol. Now, I want to create a list of Twitter Instances each initialized with a separate Accesstoken . However, I'm not able to do this. My leading cause of confusion is, that, I don't understand how Twitter4j instantiates Twitter instances. I don't understand the difference between TwitterFactory.getSingleton() method and

Renew long lived access token server side

眉间皱痕 提交于 2019-12-01 04:45:20
We are retrieving the long lived access token from facebook fine, however we need to renew this token automatically so that it does not expire every 60 days. Reading the documentation it says you can only exchange short lived tokens using the endpoint. As we don't have the short lived token, how can we do this server-side without having to manually re-authorize every 60 days? it is not possible, to extend token endlessly. See Scenario 4 here https://developers.facebook.com/roadmap/offline-access-removal/ : Using the new endpoint below, you will be able to extend the expiration time of an