I am trying to implement Stack Exchange using oAuth 2.0. I am able to get CODE but, when I try to get access_token through this code:

<form method="POST" action="https://stackexchange.com/oauth/access_token" enctype="application/x-www-form-urlencoded">
<input type="hidden" name="client_secret" value="aaaaaaaaaaaaaaaaaaaaaaaa" />
<input type="hidden" name="code" value="<?php echo $_GET['code'];?>" />
<input type="hidden" name="client_id" value="0000" />
<input type="hidden" name="redirect_uri" value="http%3A%2F%2Fmysite.com%2Fmypage.php" />
<input type="submit" name="submit" value="stack" />

<a href="https://stackexchange.com/oauth/access_token?client_id=0000&client_secret=aaaaaaaaaaaaaaaaaaaaaaaa&code=<?php echo $_GET['code'];?>&redirect_uri=http%3A%2F%2Fmysite.com%2Fmypage.php">abcd</a>

when I click on anchor tag nothing happens, it just stays on may page only.

When I submit the form, ACCESS_TOKEN is displayed on
but its not redirecting back to my redirect_uri. If anyone can guide me, it will be very help full, thank you.

  • Yeah, it's broke and not redirecting like the docs say it should. Coulda swore it worked the last time I checked, but I don't have any active apps that need auth. – Brock Adams Aug 10 '13 at 11:54
  • @BrockAdams oh okay , thanks. i need help i am developing on app that needs questions from stack exchange based on a tags. do i need access token for it?? – Amit Parmar Aug 10 '13 at 12:44
  • No, you only need an access token for the eleven paths listed in this answer. You can read all public information, and you can search, without needing any authentication. – Brock Adams Aug 10 '13 at 13:02

You must log in to answer this question.

Browse other questions tagged .