-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathoauth2_endpoints_with_refs.yml
97 lines (93 loc) · 3.9 KB
/
oauth2_endpoints_with_refs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
openapi: '3.0.2'
info:
title: OAuth2 Token Endpoint Components
version: '1.0'
description: |-
This document omits authorization endpoint on purpose. I don't know how to describe it with OAS3 since endpoint response isn't JSON(html page). If you have any suggestion please submit an issue to this repo.
Quote from [RFC 6749 - The OAuth2.0 Authorization Framework - 2.3.1. Client Password](https://tools.ietf.org/html/rfc6749#section-2.3.1):
> Including the client credentials in the request-body using the two parameters is **NOT RECOMMENDED** and **SHOULD** be limited to clients unable to directly utilize the HTTP Basic authentication scheme (or other password-based HTTP authentication schemes).
> The parameters can only be transmitted in the request-body and **MUST NOT** be included in the request URI.
servers:
- url: https://server.example.com/
paths:
/code/token:
post:
tags:
- OAuth2
summary: Obtain access token with "authorization_code" grant.
externalDocs:
description: RFC 6749 - The OAuth2.0 Authorization Framework
url: https://tools.ietf.org/html/rfc6749#section-4.1.3
operationId: obtainAccessTokenViaCodeGrant
requestBody:
$ref: './components/requestBodies/TokenRequestCodeGrant.yml'
responses:
'200':
$ref: './components/responses/OAuth2TokenSuccessResponse.yml'
'4XX':
$ref: './components/responses/OAuth2TokenErrorResponse.yml'
security:
- ClientPasswordHttpBasic: []
/password/token:
post:
tags:
- OAuth2
summary: Obtain access token with "password" grant.
externalDocs:
description: RFC 6749 - The OAuth2.0 Authorization Framework
url: https://tools.ietf.org/html/rfc6749#section-4.3.2
operationId: obtainAccessTokenViaPasswordGrant
requestBody:
$ref: './components/requestBodies/TokenRequestPasswordGrant.yml'
responses:
'200':
$ref: './components/responses/OAuth2TokenSuccessResponse.yml'
'4XX':
$ref: './components/responses/OAuth2TokenErrorResponse.yml'
security:
- ClientPasswordHttpBasic: []
/client/token:
post:
tags:
- OAuth2
summary: Obtain access token with "client_credentials" grant.
externalDocs:
description: RFC 6749 - The OAuth2.0 Authorization Framework
url: https://tools.ietf.org/html/rfc6749#section-4.4.2
operationId: obtainAccessTokenViaClientCredentialsGrant
requestBody:
$ref: './components/requestBodies/TokenRequestClientCredentialsGrant.yml'
responses:
'200':
$ref: './components/responses/OAuth2TokenSuccessResponse.yml'
'4XX':
$ref: './components/responses/OAuth2TokenErrorResponse.yml'
security:
- ClientPasswordHttpBasic: []
/refresh/token:
post:
tags:
- OAuth2
summary: Refresh access token.
externalDocs:
description: RFC 6749 - The OAuth2.0 Authorization Framework
url: https://tools.ietf.org/html/rfc6749#section-6
operationId: obtainAccessTokenViaRefreshGrant
requestBody:
$ref: './components/requestBodies/TokenRequestRefreshGrant.yml'
responses:
'200':
$ref: './components/responses/OAuth2TokenSuccessResponse.yml'
'4XX':
$ref: './components/responses/OAuth2TokenErrorResponse.yml'
security:
- ClientPasswordHttpBasic: []
components:
securitySchemes:
ClientPasswordHttpBasic:
description: |-
Clients in possession of a client password MAY use the HTTP Basic authentication scheme as defined in [[RFC2617](https://tools.ietf.org/html/rfc2617)] to authenticate with the authorization server.
Use "client_id" as username and "client_secret" as password.
[RFC 6749 - 2.3.1. Client Password](https://tools.ietf.org/html/rfc6749#section-2.3.1)
type: http
scheme: Basic