Skip to content

Commit 3612d82

Browse files
committed
feat: describe OAuth2 input types
1 parent 9f49a7f commit 3612d82

File tree

1 file changed

+142
-10
lines changed

1 file changed

+142
-10
lines changed

api_spec.yaml

Lines changed: 142 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1762,6 +1762,11 @@ paths:
17621762
operationId: oauthLoginGET
17631763
parameters:
17641764
- $ref: '#/components/parameters/apiBasePath'
1765+
- in: query
1766+
name: loginChallenge
1767+
required: true
1768+
schema:
1769+
type: string
17651770
description: |
17661771
Continues the OAuth2 login flow after the login page
17671772
responses:
@@ -1797,7 +1802,7 @@ paths:
17971802
parameters:
17981803
- $ref: '#/components/parameters/apiBasePath'
17991804
description: |
1800-
Starts the OAuth2 login flow
1805+
Starts the OAuth2 login flow - for a detailed description of all input parameters please see the OAuth2 and OpenID Connect Core specs
18011806
responses:
18021807
'302':
18031808
description: Redirects the user to the login page or back to the client app
@@ -1831,7 +1836,7 @@ paths:
18311836
parameters:
18321837
- $ref: '#/components/parameters/apiBasePath'
18331838
description: |
1834-
Exchanges an OAuth2 grant (e.g.: authorization code) for an access token (and optionally a refresh/id token)
1839+
Exchanges an OAuth2 grant (e.g.: authorization code) for an access token (and optionally a refresh/id token) - for a detailed description of all input parameters please see the OAuth2 and OpenID Connect Core specs
18351840
responses:
18361841
'200':
18371842
description: Issued tokens
@@ -1847,27 +1852,27 @@ paths:
18471852
properties:
18481853
access_token:
18491854
type: string
1850-
desciption: 'The access token issued by the authorization server.'
1855+
description: 'The access token issued by the authorization server.'
18511856

18521857
expires_in:
18531858
type: number
1854-
desciption: 'The lifetime in seconds of the access token (integer). For example, the value "3600" denotes that the access token will expire in one hour from the time the response was generated.'
1859+
description: 'The lifetime in seconds of the access token (integer). For example, the value "3600" denotes that the access token will expire in one hour from the time the response was generated.'
18551860

18561861
id_token:
18571862
type: string
1858-
desciption: 'To retrieve a refresh token request the id_token scope.'
1863+
description: 'To retrieve a refresh token request the id_token scope.'
18591864

18601865
refresh_token:
18611866
type: string
1862-
desciption: 'The refresh token, which can be used to obtain new access tokens. To retrieve it add the scope "offline" to your access token request.'
1867+
description: 'The refresh token, which can be used to obtain new access tokens. To retrieve it add the scope "offline" to your access token request.'
18631868

18641869
scope:
18651870
type: string
1866-
desciption: 'The scope of the access token'
1871+
description: 'The scope of the access token'
18671872

18681873
token_type:
18691874
type: string
1870-
desciption: 'The type of the token issued'
1875+
description: 'The type of the token issued'
18711876
- $ref: '#/components/schemas/generalErrorResponse'
18721877

18731878
'400':
@@ -1886,6 +1891,8 @@ paths:
18861891
operationId: oauthUserInfoGET
18871892
parameters:
18881893
- $ref: '#/components/parameters/apiBasePath'
1894+
security:
1895+
- OAuth2AccessTokenBearer: []
18891896
description: |
18901897
Retrieves user information based on the access token passed to it
18911898
responses:
@@ -1970,7 +1977,39 @@ paths:
19701977
parameters:
19711978
- $ref: '#/components/parameters/apiBasePath'
19721979
description: |
1973-
Revokes an access/refresh token
1980+
Revokes an access/refresh token - the client id and secret can also be provided in an authorization header using the Basic scheme
1981+
requestBody:
1982+
content:
1983+
application/json:
1984+
schema:
1985+
type: object
1986+
required:
1987+
- token
1988+
properties:
1989+
token:
1990+
type: string
1991+
example: asdfasdfasfd
1992+
client_id:
1993+
type: string
1994+
example: st-cl-test-client
1995+
client_secret:
1996+
type: string
1997+
example: superSecret
1998+
x-www-form-urlencoded:
1999+
schema:
2000+
type: object
2001+
required:
2002+
- token
2003+
properties:
2004+
token:
2005+
type: string
2006+
example: asdfasdfasfd
2007+
client_id:
2008+
type: string
2009+
example: st-cl-test-client
2010+
client_secret:
2011+
type: string
2012+
example: superSecret
19742013
responses:
19752014
'200':
19762015
description: Revoked the access/refresh token
@@ -2005,6 +2044,26 @@ paths:
20052044
- $ref: '#/components/parameters/apiBasePath'
20062045
description: |
20072046
Introspects an access/refresh token
2047+
requestBody:
2048+
content:
2049+
application/json:
2050+
schema:
2051+
type: object
2052+
required:
2053+
- token
2054+
properties:
2055+
token:
2056+
type: string
2057+
example: asdfasdfasfd
2058+
application/x-www-form-urlencoded:
2059+
schema:
2060+
type: object
2061+
required:
2062+
- token
2063+
properties:
2064+
token:
2065+
type: string
2066+
example: asdfasdfasfd
20082067
responses:
20092068
'200':
20102069
description: Information about the token
@@ -2082,8 +2141,36 @@ paths:
20822141
operationId: oauthEndSessionPOST
20832142
parameters:
20842143
- $ref: '#/components/parameters/apiBasePath'
2144+
requestBody:
2145+
content:
2146+
application/json:
2147+
schema:
2148+
type: object
2149+
properties:
2150+
id_token_hint:
2151+
type: string
2152+
example: asdfasdfASDF
2153+
client_id:
2154+
type: string
2155+
example: st-cl-example-client
2156+
post_logout_redirect_uri:
2157+
type: string
2158+
example: https://client.example.com/logoutCallback
2159+
application/x-www-form-urlencoded:
2160+
schema:
2161+
type: object
2162+
properties:
2163+
id_token_hint:
2164+
type: string
2165+
example: asdfasdfASDF
2166+
client_id:
2167+
type: string
2168+
example: st-cl-example-client
2169+
post_logout_redirect_uri:
2170+
type: string
2171+
example: https://client.example.com/logoutCallback
20852172
description: |
2086-
Redirects the user to a page where they can log out and revoke the oauth tokens
2173+
Redirects the user to a page where they can log out and revoke the oauth tokens - for a detailed description of input parameters please see the user initiated logout spec
20872174
responses:
20882175
'302':
20892176
description: Redirects the user to the logout page or back to the client app
@@ -2114,6 +2201,21 @@ paths:
21142201
operationId: oauthEndSessionGET
21152202
parameters:
21162203
- $ref: '#/components/parameters/apiBasePath'
2204+
- in: query
2205+
name: id_token_hint
2206+
schema:
2207+
type: string
2208+
example: asdfasdfASDF
2209+
- in: query
2210+
name: client_id
2211+
schema:
2212+
type: string
2213+
example: st-cl-example-client
2214+
- in: query
2215+
name: post_logout_redirect_uri
2216+
schema:
2217+
type: string
2218+
example: https://client.example.com/logoutCallback
21172219
description: |
21182220
Redirects the user to a page where they can log out and revoke the oauth tokens
21192221
responses:
@@ -2148,6 +2250,11 @@ paths:
21482250
operationId: oauthLoginInfoGET
21492251
parameters:
21502252
- $ref: '#/components/parameters/apiBasePath'
2253+
- in: query
2254+
name: loginChallenge
2255+
required: true
2256+
schema:
2257+
type: string
21512258
description: |
21522259
Retrieves information about the OAuth2 login
21532260
responses:
@@ -2209,6 +2316,26 @@ paths:
22092316
- $ref: '#/components/parameters/apiBasePath'
22102317
description: |
22112318
Logs out the user and revokes the access/refresh tokens based on the id_token_hint passed to the end_session endpoint
2319+
requestBody:
2320+
content:
2321+
application/json:
2322+
schema:
2323+
type: object
2324+
required:
2325+
- logoutChallenge
2326+
properties:
2327+
logoutChallenge:
2328+
type: string
2329+
example: asdfasdfasfd
2330+
x-www-form-urlencoded:
2331+
schema:
2332+
type: object
2333+
required:
2334+
- logoutChallenge
2335+
properties:
2336+
logoutChallenge:
2337+
type: string
2338+
example: asdfasdfasfd
22122339
responses:
22132340
'200':
22142341
description: Accepts the logout request specified by the challenge and gets where the user should be redirected to
@@ -2792,3 +2919,8 @@ components:
27922919
type: apiKey
27932920
in: cookie
27942921
name: sRefreshToken
2922+
2923+
OAuth2AccessTokenBearer:
2924+
description: An OAuth2 access token returned by the token or authorization endpoints during OAuth flows
2925+
type: http
2926+
scheme: bearer

0 commit comments

Comments
 (0)