-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: jld3103 <jld3103yt@gmail.com>
- Loading branch information
1 parent
544e030
commit 089efa6
Showing
3 changed files
with
222 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,198 @@ | ||
{ | ||
"openapi": "3.0.3", | ||
"info": { | ||
"title": "OAuth 2.0", | ||
"description": "Allows OAuth2 compatible authentication from other web applications.", | ||
"license": { | ||
"name": "agpl" | ||
}, | ||
"version": "1.14.0" | ||
}, | ||
"paths": { | ||
"/index.php/apps/oauth2/authorize": { | ||
"get": { | ||
"tags": [ | ||
"login_redirector" | ||
], | ||
"summary": "Authorize the user", | ||
"operationId": "login_redirector-authorize", | ||
"parameters": [ | ||
{ | ||
"name": "client_id", | ||
"in": "query", | ||
"description": "Client ID", | ||
"required": true, | ||
"schema": { | ||
"type": "string" | ||
} | ||
}, | ||
{ | ||
"name": "state", | ||
"in": "query", | ||
"description": "State of the flow", | ||
"required": true, | ||
"schema": { | ||
"type": "string" | ||
} | ||
}, | ||
{ | ||
"name": "response_type", | ||
"in": "query", | ||
"description": "Response type for the flow", | ||
"required": true, | ||
"schema": { | ||
"type": "string" | ||
} | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "Client not found", | ||
"content": { | ||
"text/html": { | ||
"schema": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
}, | ||
"303": { | ||
"description": "Redirect to login URL", | ||
"headers": { | ||
"Location": { | ||
"schema": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"/index.php/apps/oauth2/api/v1/token": { | ||
"post": { | ||
"tags": [ | ||
"oauth_api" | ||
], | ||
"summary": "Get a token", | ||
"operationId": "oauth_api-get-token", | ||
"parameters": [ | ||
{ | ||
"name": "grant_type", | ||
"in": "query", | ||
"description": "Token type that should be granted", | ||
"required": true, | ||
"schema": { | ||
"type": "string" | ||
} | ||
}, | ||
{ | ||
"name": "code", | ||
"in": "query", | ||
"description": "Code of the flow", | ||
"required": true, | ||
"schema": { | ||
"type": "string" | ||
} | ||
}, | ||
{ | ||
"name": "refresh_token", | ||
"in": "query", | ||
"description": "Refresh token", | ||
"required": true, | ||
"schema": { | ||
"type": "string" | ||
} | ||
}, | ||
{ | ||
"name": "client_id", | ||
"in": "query", | ||
"description": "Client ID", | ||
"required": true, | ||
"schema": { | ||
"type": "string" | ||
} | ||
}, | ||
{ | ||
"name": "client_secret", | ||
"in": "query", | ||
"description": "Client secret", | ||
"required": true, | ||
"schema": { | ||
"type": "string" | ||
} | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "Token returned", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"required": [ | ||
"access_token", | ||
"token_type", | ||
"expires_in", | ||
"refresh_token", | ||
"user_id" | ||
], | ||
"type": "object", | ||
"properties": { | ||
"access_token": { | ||
"type": "string" | ||
}, | ||
"token_type": { | ||
"type": "string" | ||
}, | ||
"expires_in": { | ||
"type": "integer" | ||
}, | ||
"refresh_token": { | ||
"type": "string" | ||
}, | ||
"user_id": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"400": { | ||
"description": "Getting token is not possible", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"required": [ | ||
"error" | ||
], | ||
"type": "object", | ||
"properties": { | ||
"error": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"components": { | ||
"schemas": {}, | ||
"securitySchemes": { | ||
"basic_auth": { | ||
"type": "http", | ||
"scheme": "basic" | ||
} | ||
} | ||
}, | ||
"security": [ | ||
{ | ||
"basic_auth": [] | ||
} | ||
], | ||
"tags": [] | ||
} |