8
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 ...
6
votes
Accepted
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 ...
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 ...
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.
...
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,
"...
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:
&...
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 ...
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 ...
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, ...
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 ...
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 ...
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.
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 ...
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 ...
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=...
2
votes
Accepted
"Could not parse uri [redirect_uri]" when trying to authenticate
It's not explicitly mentioned in the documentation (perhaps because it uses the term URI, and says it must be 'under' a domain), but for the redirect URI I always use a 'full' address, including the ...
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 ...
1
vote
OAuth Domain can't satisfy redirect_uri AND Proxy url
What you need to do is to uncheck Disable Desktop Application OAuth Redirect Uri. This will allow your app to redirect to stackexchange.com without requiring it in the OAuth Domain. Your OAuth domain ...
1
vote
Accepted
If a client authenticates, will API requests be counted on their profile?
If you are using an access_token in a request to the SE API, then the quota which that request is counted against is the 10k requests/day for that user+application pair. Each user can have up to five ...
1
vote
Accepted
Why is no_expiry "strongly advised against"?
It is a security best practice. Tokens should be short-lived. They should be so short-lived that once captured the damage caused/cost to restore by a compromised token should be minimal. This means ...

rene♦
- 2,382
1
vote
How do I add a comment to a post through the Stack Exchange API?
For posting comments, you need a request key for your application:
Applications should be registered on Stack Apps to get a request key. Request keys grant more requests per day, and are necessary ...
1
vote
Accepted
How can I the question detail page and add comments like the Stack Exchange app?
Can we get the list of data when clicking on the specific question and display the question detail page like the Stack Exchange app?
Sure: use the /questions/{ids} method and apply the appropriate ...
1
vote
Localhost test Stack App authentication: error 'redirect_uri' does not match
I get the reason:
Do not use gem 'omniauth-stackexchange', '~> 0.2.1' ,but instead of gem 'omniauth-stackexchange', git: 'https://github.com/nashby/omniauth-stackexchange.git'
The reason see this:...
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=...
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....
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 ...
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 ...
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 ...
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.
1
vote
Accepted
Authentication uses # instead of `?`?
Refer to the generic URI syntax, it is perfectly valid to have a fragment (The optional part of a URL that starts with an octothorpe #) without a preceding query (The optional part of a URL that ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
authentication × 90support × 67
oauth2 × 41
api × 26
api-v2 × 20
bug × 15
api-v2.2 × 14
status-completed × 7
api-key × 7
discussion × 5
feature-request × 5
documentation × 5
javascript × 4
stackapps × 3
android × 3
api-v2.1 × 3
c# × 3
stackauth × 3
php × 3
users × 2
comments × 2
python × 2
.net × 2
apps × 2
quota × 2