11 votes
Accepted

Unable to get access token

Refer to the Stack Exchange API, Authentication docs. It looks like you are trying to authenticate using either a server you do not control, or a local server that is not on the public internet. ...
user avatar
  • 12.6k
6 votes

Does a closed and/or deleted Stack Apps post still provide access to the API?

I've just done a couple of tests with my placeholder app. Even though the question is closed, I was able to generate a new access token (following the regular procedure) for my sockpuppet account, and ...
user avatar
  • 5,265
5 votes
Accepted

Getting "application not configured for implicit grants" error trying to setup website

Yes, it can be annoying that the API docs, the javascript SDK, and the settings pages use the terms: "Explicit" "Implicit" "Server side" "Client side" a little interchangeably. (The first 2 are ...
user avatar
  • 12.6k
5 votes
Accepted

OAuth procedure for standalone user?

Refer to the API Authentication doc page, where it says: explicit grant (is) for server side applications Also, see What is the difference between the 2 workflows? and related questions. ...
user avatar
  • 12.6k
5 votes
Accepted

No website (yet), how to register?

Reference: Stack Exchange API Authentication Looking for a beginner's tutorial to using the API Yeah the registration form now says, "Website URL is required". So, if you don't have your own ...
user avatar
  • 12.6k
4 votes
Accepted

Can not request info after OAuth

Your second call must be https:. You actually got an error like: "error_id":406, "error_message":"Access token sent over non-HTTPS request, it has been invalidated", "error_name":"...
user avatar
  • 12.6k
4 votes
Accepted

After user login, how do you ask user for permissions?

I forgot to add the scope in the authentication url according to this document https://api.stackexchange.com/docs/authentication#scope 1.Send a user to https://stackexchange.com/oauth, with these ...
user avatar
  • 229
4 votes
Accepted

Refresh expired acess token basics

Dealing with token expiration is pretty simple. When a token is/goes bad then, when you make an API call that uses the token, you will get a JSON response like this: { "error_id": 403, "...
user avatar
  • 12.6k
3 votes
Accepted

Cannot get redirect_uri to work

There have been no reported changes to the API, officially for many years, (unofficially since January). But, frankly that script's approach should have never worked. OAuth credentials are sent to: &...
user avatar
  • 12.6k
3 votes
Accepted

Access token keeps being invalidated

Turns out this is completely my fault :/ I overlooked the expiry aspect of the access token which meant that I got the default 86399 seconds (~24 hours), which meant my users had to get a new access ...
user avatar
  • 4,195
3 votes
Accepted

Accessing the Stack Exchange API not on behalf of an user?

You only need to use OAuth if you are trying to add or modify data (including votes). If you want to do that, your app must log in as a user, no exceptions. If you just want to read or search data, ...
user avatar
  • 12.6k
3 votes
Accepted

Is there a way to specify how long I want an access token to be valid for?

Yes, I always get 86399 too. And, no, you can't specify an interval other than no_expiry. But you can call /access-tokens/{accessTokens}/invalidateDoc at whatever interval you wish. So, for less ...
user avatar
  • 12.6k
3 votes
Accepted

iOS Client for stackoverflow always throws redirect_uri not a valid uri

That error means either that you've misconfigured the app or that the authentication call is incorrect. Note that stackexchange.com/oauth/login_success is not a valid redirect_uri irregardless. You ...
user avatar
  • 12.6k
3 votes

'The target origin provided does not match the recipient window's origin' message when trying to use localhost

I faced the same issue when I was using the stack exchange API to post a message to stack overflow website. I figured I had to post my application on a domain name. I hosted my application on free ...
user avatar
3 votes
Accepted

How can I quickly get an access token for personal use?

It's possible to authenticate yourself via the command line; there's no need to set up a website or so. Open the application page via https://stackapps.com/apps/oauth and make sure the option 'Enable ...
user avatar
  • 5,265
2 votes
Accepted

Login using Google fails saying OpenID 2.0 accounts for Google has gone away

So, this was a fun one. :) We apparently broke several different things over the course of a year that went unnoticed until Google turned off OpenID support. In no particular order but for fun and ...
user avatar
  • 313
2 votes

How to programmatically retrieve the access_token from client-side OAuth flow?

In a nutshell and don't know ask me how to write this in C#: That first "500 error" page is normal. You must display that to the user and the user must approve. When the user approves, the page will ...
user avatar
  • 12.6k
2 votes

Application Key and AccessToken are not working for Stack Exchange API?

In my particular case, I somehow managed to append % character to the end of the access_token. There should be no % character at the end of the access_token.
user avatar
  • 163
2 votes

I Cannot Perform Oauth

The authentication process is described in the API docs: http://api.stackexchange.com/docs/authentication.
user avatar
  • 313
2 votes
Accepted

Same access token between different fetch_token requests

Yes, each time you invoke stackexchange.com/oauth/ you will get a fresh access token, even though old ones may still be valid. For example: Go to /me/inboxLivedoc and hit Get Token twice, recording ...
user avatar
  • 12.6k
2 votes
Accepted

No 'Access-Control-Allow-Origin' for oauth/access_token

The question is not clear enough. You appear to be trying to use jQuery to do explicit OAuth from a web page. If so, this is not allowed. Explicit OAuth is for servers. You are not running that ...
user avatar
  • 12.6k
2 votes
Accepted

I have created a lot of access_token with no_expiry scope while experimenting. How do I delete them?

This is what the /apps/{accessTokens}/de-authenticate route does. Passing valid access_tokens to this method causes the application that created them to be de-authorized by the user associated with ...
user avatar
  • 12.6k
2 votes
Accepted

How to use /me to display my profile data in StackExchange API?

For read requests, you must send the token (and key) in the URL. For example: https://api.stackexchange.com/2.2/me?site=stackoverflow&key=dp55hR5Wr9UhOJReA6F2gg((&access_token=...
user avatar
  • 12.6k
2 votes
Accepted

Get access token for matrix bridge

Yes, you do. The only way to get access token is via authentication, and you need a registered application for that. What you don't need is a public post here to announce your application; that is ...
user avatar
  • 5,265
1 vote
Accepted

The new implicit authentication dialog doesn't handle comma-delimited scopes

This appears to have been silently fixed, sometime in the last year. Now, both: https://stackexchange.com/oauth/dialog?client_id=1515&scope=read_inbox,write_access,private_info&redirect_uri=...
user avatar
  • 12.6k
1 vote
Accepted

oauth 2.0 based on stackexchange api and fetch user details

You can do this using the /me endpoint or the /me/associated endpoint. /me Returns the user associated with the passed access_token. Use this if you want to get user info for a specific site (e.g....
user avatar
  • 126
1 vote
Accepted

Stack Exchange login hangs on Windows 10 Mobile?

I had to change the structure of Authentication on my App. For windows 10, I use AuthenticationBroker but for Windows 10 Phone I used the old WebView Model and completed login implementation.
user avatar
  • 269
1 vote

What token parameters to use for OAuth2 Authorizaton?

What software are you using? Anyway, for a Desktop app, you almost always use the "Implicit" (Client side) procedure. Configure your Stack app as shown in this answer. That dialog appears to be set ...
user avatar
  • 12.6k
1 vote
Accepted

Is it okay to just send the API key (without implementing oauth-2 login)?

Yes, it is perfectly okay. You only need an access_token (OAuth/login) if you are trying to change data, or are accessing private information for a logged-in user. See the Authentication docs for ...
user avatar
  • 12.6k
1 vote

DSS: Facilitating API authentication for desktop apps

I think, in the name of being cooperative, anybody using this should consider generating a key that is prefixed by their app's client ID, e.g. if your app ID is 3456: 3456-<uuid> Sticking to ...
user avatar
  • 571

Only top scored, non community-wiki answers of a minimum length are eligible