-
Notifications
You must be signed in to change notification settings - Fork 47
/
Copy pathoauth.openapi.yaml
94 lines (93 loc) · 2.57 KB
/
oauth.openapi.yaml
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
openapi: 3.1.0
info:
title: Example OAuth service
version: 1.0.0
contact:
email: info@example.com
description: >-
OAuth service
x-optic-path-ignore:
- "**/*.+(ico|png|jpeg|jpg|gif)"
servers:
- url: https://auth.example.com
description: Example OAuth Production
paths:
/authorize:
get:
operationId: authorize
description: >-
This endpoint is used to authorize a user to access the Example API.
The user will be redirected to the login page if they are not already
logged in. If they are logged in, they will be asked to authorize the
application to access their account. If they accept, they will be
redirected back to the application with an authorization code.
parameters:
- name: client_id
in: query
required: true
schema:
type: string
- name: redirect_uri
in: query
required: true
schema:
type: string
- name: response_type
in: query
required: true
schema:
type: string
- name: scope
in: query
required: true
schema:
type: string
- name: state
in: query
required: true
schema:
type: string
responses:
"200":
description: 200 response
/oauth/token:
post:
operationId: get-token
description: >-
This endpoint is used to get an access token from an authorization code.
The authorization code is obtained from the authorize endpoint.
requestBody:
content:
application/x-www-form-urlencoded:
schema:
type: object
properties:
grant_type:
type: string
code:
type: string
redirect_uri:
type: string
client_id:
type: string
client_secret:
type: string
required:
- grant_type
- client_id
responses:
"200":
description: 200 response
# callback:
# myCallback:
# '{$request.query.queryUrl}':
# post:
# requestBody:
# description: Callback payload
# content:
# 'application/json':
# schema:
# $ref: '#/components/schemas/SomePayload'
# responses:
# '200':
# description: callback successfully processed