This repository was archived by the owner on Feb 18, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenapi.yaml
More file actions
134 lines (130 loc) · 4.5 KB
/
openapi.yaml
File metadata and controls
134 lines (130 loc) · 4.5 KB
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
openapi: 3.0.0
info:
title: Auth Integration API
version: 1.0.0
description: Authentication API with AWS Cognito integration
contact:
name: API Support
email: support@example.com
servers:
- url: https://api.example.com/v1
description: Production server
- url: https://staging-api.example.com/v1
description: Staging server
- url: http://localhost:3000/v1
description: Development server
paths:
/oauth2/token:
post:
summary: Get OAuth2 Token (AWS Cognito)
description: |
Get an access token from AWS Cognito using client credentials flow.
This endpoint is used to authenticate with AWS Cognito and get a token
that can be used to access protected resources.
tags:
- AWS Cognito
requestBody:
required: true
content:
application/x-www-form-urlencoded:
schema:
type: object
properties:
grant_type:
type: string
enum: [client_credentials]
example: client_credentials
description: OAuth2 grant type
client_id:
type: string
example: "your_client_id_here"
description: AWS Cognito client ID
client_secret:
type: string
example: "your_client_secret_here"
description: AWS Cognito client secret
scope:
type: string
example: "cognito-api-scope"
description: OAuth2 scope for the requested token
required:
- grant_type
- client_id
- client_secret
- scope
examples:
cognito_auth_dev:
summary: Development Environment
value:
grant_type: "client_credentials"
client_id: "your_dev_client_id"
client_secret: "your_dev_client_secret"
scope: "cognito-api-scope"
cognito_auth_staging:
summary: Staging Environment
value:
grant_type: "client_credentials"
client_id: "your_staging_client_id"
client_secret: "your_staging_client_secret"
scope: "cognito-api-scope"
cognito_auth_prod:
summary: Production Environment
value:
grant_type: "client_credentials"
client_id: "your_prod_client_id"
client_secret: "your_prod_client_secret"
scope: "cognito-api-scope"
responses:
'200':
description: Token obtained successfully
content:
application/json:
schema:
type: object
properties:
access_token:
type: string
example: "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9..."
description: JWT access token
token_type:
type: string
example: "Bearer"
description: Token type
expires_in:
type: integer
example: 3600
description: Token expiration time in seconds
scope:
type: string
example: "cognito-api-scope"
description: Granted scope
required:
- access_token
- token_type
- expires_in
'400':
description: Bad request - Invalid parameters
content:
application/json:
schema:
type: object
properties:
error:
type: string
example: "invalid_request"
error_description:
type: string
example: "Missing required parameter: client_id"
'401':
description: Unauthorized - Invalid client credentials
content:
application/json:
schema:
type: object
properties:
error:
type: string
example: "invalid_client"
error_description:
type: string
example: "Client authentication failed"