Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <ol> <li><p>You cannot add anything to the redirect uri, redirect uri is constant as set in the app settings of Oauth. eg :<a href="http://www.example.com/redirect.html" rel="noreferrer">http://www.example.com/redirect.html</a></p></li> <li><p>To pass several parameters to your redirect uri, have them stored in <code>state</code> parameter before calling Oauth url, the url after authorization will send the same parameters to your redirect uri as <code>state=THE_STATE_PARAMETERS</code></p></li> </ol> <p>So for your case,do this:</p> <p>/1. create a json string of your parameters -> </p> <p><code>{ "a" : "b" , "c" : 1 }</code></p> <p>/2. do a base64UrlEncode , to make it URL safe -> </p> <pre><code>stateString = base64UrlEncode('{ "a" : "b" , "c" : 1 }'); </code></pre> <p>This is a PHP example of base64UrlEncoding &amp; decoding (<a href="http://en.wikipedia.org/wiki/Base64#URL_applications" rel="noreferrer">http://en.wikipedia.org/wiki/Base64#URL_applications</a>) : </p> <pre><code>function base64UrlEncode($inputStr) { return strtr(base64_encode($inputStr), '+/=', '-_,'); } function base64UrlDecode($inputStr) { return base64_decode(strtr($inputStr, '-_,', '+/=')); } </code></pre> <p>So now state would be something like: stateString -> asawerwerwfgsg,</p> <p>Pass this state in OAuth authorization URL:</p> <pre><code>https://accounts.google.com/o/oauth2/auth? client_id=21302922996.apps.googleusercontent.com&amp; redirect_uri=https://www.example.com/back&amp; scope=https://www.google.com/m8/feeds/&amp; response_type=token&amp; state=asdafwswdwefwsdg, </code></pre> <p>For server side flow it will come along with token : <a href="http://www.example.com/redirect.html?token=sdfwerwqerqwer&amp;state=asdafwswdwefwsdg" rel="noreferrer">http://www.example.com/redirect.html?token=sdfwerwqerqwer&amp;state=asdafwswdwefwsdg</a>,</p> <p>For client side flow it will come in the hash along with access token: <a href="http://www.example.com/redirect.html#access_token=portyefghsdfgdfgsdgd&amp;state=asdafwswdwefwsdg" rel="noreferrer">http://www.example.com/redirect.html#access_token=portyefghsdfgdfgsdgd&amp;state=asdafwswdwefwsdg</a>,</p> <p>Retrieve the state, base64UrlDecode it, json_decode it, and you have your data.</p> <p>See more about google OAuth 2 here:</p> <p><a href="http://code.google.com/apis/accounts/docs/OAuth2.html" rel="noreferrer">http://code.google.com/apis/accounts/docs/OAuth2.html</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload