Getting Error when try to get Pinterest Access Token - java

My question is similar to this one.
I have followed every step trying to get a Pinterest access token.
https://developers.pinterest.com/docs/api/overview/
I '
1. Created an app in the Pinterest developer dashboard
2. Got my authorization code without any problems
3. Tried to query my access token like in the docs:
POST https://api.pinterest.com/v1/oauth/token?grant_type=authorization_code&client_id=888888888888888&client_secret=9999999999999999999999&code=00000000000000
I tried to get it using curl command also.
Using Postman to get an access token is possible(Configure the OAuth flow:).
But from java or postman i pull above endpoint then getting this error {"error": "invalid_grant"}
Can anybody help me and tell me what could go wrong and how to fix it?
Thank you!

Related

Error when generating token to get access to the docusign for postman

I'm trying to generate an access token following the docusign documentation, but when it arrives at the part of the sequence incorporated in the url, I can't generate the signature compatible with what is requested RSA-256.
This is the token that returns in the url, how should i proceed to generate the correct token to get the access token to the methods.
eyJ0eXAiOiJNVCIsImFsZyI6IlJTMjU2Iiwia2lkIjoiNjgxODVmZjEtNGU1MS00Y2U5LWFmMWMtNjg5ODEyMjAzMzE3In0.AQsAAAABAAYABwCAWdDpkO_YSAgAgOVWMZHv2EgCAC8x_aWgjDdEpqZZDhWJAksVAAEAAAAYAAIAAAAFAAAAHQAAAA0AJAAAADY4ZDFlYTk3LTk5ZDMtNDM4MS05MmY5LTg3ZTdlMWFiMWIzOCIAJAAAADY4ZDFlYTk3LTk5ZDMtNDM4MS05MmY5LTg3ZTdlMWFiMWIzODAAgFnQ6ZDv2EgSAAEAAAALAAAAaW50ZXJhY3RpdmU3AF2EwqcBnYBHm1UeBpeUZIA.5AiJJl_ugWRECf7jTD7DchgUZV_Mk30cXJwmPAMkThH9dwtu2A9ehMwkARi0QvmSIoo1Pk-gUj2U_GMAk9flG5IAHVYIPcy9hbWMcRyr7RMYldKqvh2V8UH4-Uv5BBQNHkwQ36spfuYFaafDLHVq86Mt91m4MK-ZByRzZkboQKNHCaNjani-hPNTlhHkkWuKOPTu8R9GY24TvNhRu9ILYRgRUFsXG3E-ptNFTyhdKM8_RuNQrqed9ZA2oPo4WjNm-b1VIFdVElU3duniBS-inWJD2ifzp8N1zKFm_Nv8UMjpZOtitdW0M4QQ7rXG6Q-6xoNE_ODWQZUWsD2mQaz4_A
Is there any configuration in the sandbox that may be generating this token wrongly? Whatever it is i need help to generate this token in postman, because i need to integrate with my API and test the methods before coding.
Here is how you generate a token with Postman using Authorization Code Grant:
Open a browser and go to this URL (after you updated it with your info) https://account-d.docusign.com/oauth/auth?response_type=code&scope=signature&client_id={iKey}&redirect_uri={callback}
If it's configured correctly, you should now be redirected back to your redirectUri with an additional URL parameter called code.
Copy/paste this code into your Postman application. You would have to copy/paste the code that you obtained from the URL parameter into the Body key/value pair (replacing the {{codeFromUrl}} value). Note that the code is valid for two minutes only. If you don’t send this information to DocuSign quickly enough, you will have to obtain a new code again. Hit the Send button at the top of Postman to make the call to DocuSign.
Now, you indicated you are using Java, so another approach for you may be to use our Quickstart and select Java. That will take care of all the Auth configuration for you.

Java integration with Docu Sign

I am trying to integrate docusign with java application.
I am following Github example which is working.
https://github.com/docusign/docusign-java-client
Here I am just changing Integrator key,clientId and private key but is not working.
https://github.com/docusign/docusign-java-client/blob/master/src/test/java/SdkUnitTests.java
Here I have attached how I am copying key and id etc...
https://gitlab.com/sanju24689/docusign
Here I have also attached my code also.
It's giving me error like
"com.docusign.esign.client.ApiException: Error while requesting an
access token: POST https://account-d.docusign.com/oauth/token returned
a response status of 400 Bad Request"
See the stack trace
Please try starting with the Java webapp that is ready to go--it is a complete project.
See eg-03-java-auth-code-grant

Android error Login with twitter failure, failed to get request token

Has anyone else encountered this error before when trying to integrate twitter apis though Fabric? All i want to do is allow the user to sign in but whenever i click the twitter button it brings me to a white page and then gives me the error
failed to get request token
I just got the Solution of my Problem.
Actually I haven't add the callback url to the app on Twitter. That's why i am not getting the permitted Window.
Now i have added the url like http://myurl.com and now my problem solved.

Facebook Oauth Issue | Multiple redirect with changing "code" parameter value in redirected url

We are integrating our Silverlight based Desktop Application ( which talks to Servlet based backend solution ) with Facebook login. We are able to redirect to Facebook login page using below url
https://www.facebook.com/dialog/oauth?client_id=<client id>&redirect_uri=http://localhost.example.com/fbsignin&scope=email
But the issue here is that somehow Facebook is redirecting Infinite/multiple times (with different-2 code value ) to our redirect url.
I checked on internet for same, and I think it is kind of known problem but all solutions provided only ask about updating PHP files or it SDK, but I am working on Servlet based bacend solution and not able to find any suitable solution to stop this multiple redirect.
Any Suggestion?
thanks
I think I had a similar issue.
When you get a request with the 'code' parameter, then you will want to send that back to FB. Doing so will allow you to get an 'access_token' in return.
Relevant documentation can be read at this link: Login Flow
And for clarity you would want to exchange the 'code' parameter for and 'access_token' by this GET request.
GET https://graph.facebook.com/oauth/access_token?
client_id={app-id}
&redirect_uri={redirect-uri}
&client_secret={app-secret}
&code={code-parameter}
In general, your question is similar to this question:
Get Facebook OAuth token from code parameter

twitter4j - How to configure?

I am trying to write a simple twitter client using twitter4j, but I can't seem to get past the first step - configuring the parameters. There is a configuration page on the site that says I need to have a twitter.properties file at root with following contents:
debug=true
oauth.consumerKey=*********************
oauth.consumerSecret=******************************************
oauth.accessToken=**************************************************
oauth.accessTokenSecret=******************************************
What I am unable to figure out is what should go in place of the asterisks, and how do I obtain those values? Please help.
PS: This is my first time with OAuth and twitter4j, so please be gentle!
Login to https://dev.twitter.com through your Twitter credentials.
And at homepage Click on Create an app and fill all the details .
You will get all the required key/secret.

Categories