Jump to content

Requesting an oauth code with a redirect uri with query parameters


 Share

Recommended Posts

I have a need to pass an extra query parameter to the API when requesting a code because I need to retain context for an object id (the invocation is happening within an AWS lambda and I lose context when Intacct returns the code). Can I just submit a redirect uri that already has a query parameter attached, e.g.:

http://myhost.com?id=123

Will the api just append "&code=x" to the end when it invokes the url, or will it choke? If the answer is "it will choke", how do I pass in values that I need regurgitated back to me?

Link to comment
Share on other sites

  • Members

When you make a token request you can pass this in the query string: "state" and set the value to whatever you want, that value will carry forward to your callback url.

 

$url = AUTH_URL."?"
     ."state=anything"
   ."&response_type=code"
   ."&client_id=". CLIENT_ID
   ."&scope=". SCOPE
   ."&redirect_uri=". CALLBACK_URL;

Link to comment
Share on other sites

 Share

×
×
  • Create New...