Authorization Display & video 360 API - rest

I would like generate the token to google apis.
I'm using this url:
https://oauth2.googleapis.com/token
and the body is :
grant_type:authorization_code
client_id: ***********
client_secret:*********
code:code
and I got the resposne :
{
"error": "invalid_grant",
"error_description": "Malformed auth code."
}
Someone could help me to generate the token ?

I have gotten this error before and after trying out a few things, I figured it out. Can you try to add access_type: 'offline' to your request body?
Here is an example in Node JS: https://developers.google.com/identity/protocols/oauth2/web-server#node.js_7

Related

Microsoft Graph Expired Token

I'm trying to perform a request in Microsoft Graph like this one with Postman
https://graph.windows.net/<Tenant>/users?api-version=1.6
For the Authorization, I'm using Bearer. I'm retrieving the token manually and decoding it here https://jwt.io/ That way I know that it's well formed and that it's not expired yet.
However, I'm getting the following error on the response:
{
"odata.error": {
"code": "Authentication_ExpiredToken",
"message": {
"lang": "en",
"value": "Your access token has expired. Please renew it before submitting the request."
}
}
}
What am I doing wrong?
You an try Get App-Only Access Token with the Microsoft Graph POST API:
https://login.microsoftonline.com/{{TenantID}}/oauth2/v2.0/token

Can We Access Facebook Api Using Postman client

I want to access my full details using facebook api . I am using postman client for this and hit api as
URL : graph.facebook.com/v2.2/me
METHOD : GET
HEADER PARAMETER :
AccessToken : djbjd
AppID : dsdmds
AppSecret :sdkkd
Now I get response :
STATUS : 400 Bad Request and Response
"error": {
"message": "An active access token must be used to query information about the current user.",
"type": "OAuthException",
"code": 2500,
"fbtrace_id": "AQt0krgrd2U"
}
}
Can anyone tell me how I can hit facebook api using postman client .
You only need one GET parameter for this, the access_token parameter. It must be a valid User Token or Page Token.
You can also just try this in the browser directly: https://graph.facebook.com/me?access_token=xxx
I've been using Bearer Token to input the access token on Postman Client. The cool thing about it is you can add it to the folder and have every query inside the folder inherit it from the parent.
This lets me focus on the call and use each folder as an environment for calls related to the same object Page, App, Messenger and other tests

Facebook SDK AppRequests Error: OAuthException

I want to read the user's apprequest-id. I've already finish the function below:
get server token:
url = "https://graph.facebook.com/oauth/access_token?client_id=#{app_id}&client_secret=#{secret_key}&grant_type=client_credentials"
then, i built the function that sending user_token to server as {client_access_token}
So, I call this function to get AppRequest as json
url = "https://graph.facebook.com/v2.3/#{fb_id}/apprequests/?input_token=#{client_access_token}&access_token=#{server_access_token}"
And i got this error:
{
"error": {
"message": "(#15) Requires session when calling from a desktop app",
"type": "OAuthException",
"code": 15
}
}
At first, I think that there are something wrong with the URL calling or access token, but I've already test another graph api such as "/me/friends" and "/me/?fields=installed" with the same input_token and access_token. And, it works normally. Please help.
This problem has been solve by using {client_access_token} as access_token :)
url = "https://graph.facebook.com/v2.3/#{fb_id}/apprequests/?access_token=#{client_access_token}"

Yodlee REST login - Invalid cobrand conversation credential

Following the REST quick start tutorial I am sending a request to https://rest.developer.yodlee.com/services/srest/restserver/v1.0/authenticate/login with login, password and cobSessionToken just taken from the https://rest.developer.yodlee.com/services/srest/restserver/v1.0/authenticate/coblogin endpoint but I get this reply:
{
"Error": [
{
"errorDetail": "Invalid cobrand conversation credentials"
}
]
}
What could be the problem?
Here you can see the full details of my request in Postman
Thank you
Could you please check the cobSessionToken value in the request you have in PostMan after pasting? It seems like PostMan is trimming last character from cobSessionToken value which you are pasting from response of first call.
I am suspecting this is the issue, else if this is not the case then please try once in AdvanceRest Client.

Exchanging oauth2 authorization code with access token

In my metro application, I am using google drive apps to get the files from drive.
After I get the code, I am getting error 400 (Invalid request) while exchanging it with access token.
This is my POST request:
https://accounts.google.com/o/oauth2/token?client_id=59349429483.apps.googleusercontent.com&client_secret={DELETED_INTENTIONALLY}&code=4%2FY-rI6ye27Msho3mxmkT7cyDxWzDs&grant_type=authorization_code&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob
The response I am getting is:
Status: 400
Response: {
"error" : "invalid_request"
}
Could anyone please let me know the problem with my request? I am setting the request parameters exactly as per google's documentation.