4.2 KiB
4.2 KiB
setting
Allow Implicit Grant
a way to return token directly to client, you can google itEnforce State Validation
state
must be providedRequire Exact Redirect URI
url inredirect_uri
should be exactly the same as the one of clientAccess Token Lifetime
create a client
instructions
Name
name of clientDescription
description of clientIcon
icon of client, optionalHomepage
homepage of client, optionalRedirect URI
redirect uri of client, required, multiple uri should be separated by space (not recommended)Scopes
optional (don't fill it if you don't know)Grant Types
optional (don't fill it if you don't know)Client ID
andClient Secret
used for client authentication, generated automatically, don't share it with others
set scope for your resources (user.read is default scope)
most people only need user.read
scope, if you need more, you can add it here (maybe you need to know something about OAuth scope first)
instructions
Scope ID
unique identifier of scope, used for distinguish, you can refer toGithub
scopeResource Path
resource path of scopeRequest Method
request method of resource path, usuallyGET
Default
if checked, this scope will be added even if it's not inscope
parameterName
name of scope, used for displayDescription
description of scope, used for display, you can use{user}
{client_name}
variable to represent user and client nameIcon
supportFontAwesome
icon and normal image
uri
authorize
/oauth/authorize
param | description | required | default | example |
---|---|---|---|---|
client_id | client id | yes | none | 123456 |
response_type | grant type | yes | none | code or token |
redirect_uri | redirect uri | yes | client redirect uri | https://example.com/oauth/callback |
scope | scope | no | none | user.read |
state | state | no | none | 123456 |
example:
GET https://example.com/oauth/authorize?client_id=123456&response_type=code&redirect_uri=https://user.example.com/oauth/callback&scope=user.read&state=123456
token
/oauth/token
param | description | required | default | example |
---|---|---|---|---|
client_id | client id | yes | none | 123456 |
client_secret | client secret | yes | none | 123456 |
grant_type | grant type | yes | none | authorization_code or refresh_token |
code | authorization code | required when grant type is authorization_code | none | 123456 |
refresh_token | refresh token | required when grant type is refresh_token | none | 123456 |
redirect_uri | redirect uri | required when grant type is authorization_code | client redirect uri | https://example.com/oauth/callback |
example:
POST https://example.com/oauth/token
Payload: client_id=123456&client_secret=123456&grant_type=authorization_code&code=123456&redirect_uri=https://example.com/oauth/callback
resource
/api/user
param | description | required | default | example |
---|---|---|---|---|
access_token | access token | yes | none | 123456 |
example
GET https://example.com/api/user?access_token=123456