Skip to content

Commit 74f2190

Browse files
committed
Added new routes for OIDC functionality
1 parent d9e6492 commit 74f2190

File tree

3 files changed

+119
-3
lines changed

3 files changed

+119
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
66

77
## [Unreleased]
88

9+
### Added
10+
- Added two new routes which provide information on enabled OIDC providers and updated the OIDC authenticate route.
11+
[cyberark/conjur-openapi-spec#220](https://github.com/cyberark/conjur-openapi-spec/pull/220)
12+
913
## [5.3.0] - 2021-12-22
1014

1115
### Added

spec/authentication.yml

Lines changed: 112 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,19 @@ components:
1616
"signature": "NrknEA762z0x-FVdQjFGeTT.....AFjHc0"
1717
}
1818

19+
OIDCAuthResponse:
20+
type: object
21+
properties:
22+
authentication_token:
23+
type: string
24+
bearer_token:
25+
type: string
26+
example:
27+
{
28+
"authentication_token": "kashdbgjkahbfglian..kajshfbkjashbfg",
29+
"bearer_token": "hbgLKGrkjbKGbkhbk...gKSkgkhksjdbBG"
30+
}
31+
1932
JWTToken:
2033
type: object
2134
properties:
@@ -92,6 +105,16 @@ components:
92105
"id_token": "eyJhbGciOiJSUzI1NiIs......uTonCA"
93106
}
94107

108+
OIDCInfo:
109+
type: object
110+
properties:
111+
service_id:
112+
type: string
113+
redirect_uri:
114+
type: string
115+
required:
116+
- service_id
117+
95118
UserId:
96119
type: string
97120
minLength: 1
@@ -124,6 +147,28 @@ components:
124147
schema:
125148
type: string
126149

150+
OIDCInfo:
151+
description: "Description of a specific OIDC provider"
152+
content:
153+
text/plain:
154+
schema:
155+
$ref: '#/components/schemas/OIDCInfo'
156+
157+
OIDCInfoList:
158+
description: "List of all OIDC provider information"
159+
content:
160+
text/plain:
161+
schema:
162+
type: array
163+
items:
164+
$ref: '#/components/schemas/OIDCInfo'
165+
166+
OIDCAuthResponse:
167+
description: "Response contains tokens allowing for authentication with Conjur"
168+
content:
169+
text/plain:
170+
schema:
171+
$ref: "#/components/schemas/OIDCAuthResponse"
127172
paths:
128173
DefaultLogin:
129174
parameters:
@@ -181,7 +226,6 @@ components:
181226
security:
182227
- basicAuth: []
183228

184-
185229
K8sInjectClientCert:
186230
parameters:
187231
- $ref: 'openapi.yml#/components/parameters/RequestID'
@@ -750,8 +794,73 @@ components:
750794
$ref: 'openapi.yml#/components/responses/BadRequest'
751795
"401":
752796
$ref: 'openapi.yml#/components/responses/UnauthorizedError'
753-
"404":
754-
$ref: 'openapi.yml#/components/responses/ResourceNotFound'
797+
get:
798+
tags:
799+
- "authentication"
800+
summary: |
801+
Gets a short-lived access token for applications using OpenID
802+
Connect (OIDC) to access the Conjur API.
803+
description: |
804+
Use the OIDC Authenticator to leverage the identity layer
805+
provided by OIDC to authenticate with Conjur.
806+
807+
For more information see [the documentation](https://docs.conjur.org/Latest/en/Content/OIDC/OIDC.htm).
808+
operationId: "getAccessTokenViaOIDCV2"
809+
parameters:
810+
- $ref: openapi.yml#/components/parameters/ServiceID
811+
812+
- name: "account"
813+
in: "path"
814+
required: true
815+
description: "Organization account name"
816+
schema:
817+
$ref: 'openapi.yml#/components/schemas/AccountName'
818+
819+
- name: "code"
820+
in: "query"
821+
required: true
822+
description: "The code retrieved from the OIDC server"
823+
schema:
824+
type: string
825+
826+
- name: "state"
827+
in: "query"
828+
required: true
829+
description: "The state passed to the OIDC server on code retrieval"
830+
schema:
831+
type: string
832+
833+
responses:
834+
"200":
835+
$ref: '#/components/responses/AccessToken'
836+
"400":
837+
$ref: 'openapi.yml#/components/responses/BadRequest'
838+
"401":
839+
$ref: 'openapi.yml#/components/responses/UnauthorizedError'
840+
841+
ListOIDCAuthenticators:
842+
parameters:
843+
- $ref: 'openapi.yml#/components/parameters/RequestID'
844+
get:
845+
tags:
846+
- "authentication"
847+
summary: |
848+
Gets basic information about the requested OIDC provider
849+
description: |
850+
Gets basic information about the requested OIDC provider. This includes
851+
the redirect uri for authenticating using OIDC.
852+
operationId: "listOIDCProviders"
853+
parameters:
854+
- name: "account"
855+
in: "path"
856+
required: true
857+
description: "Organization account name"
858+
schema:
859+
$ref: 'openapi.yml#/components/schemas/AccountName'
860+
861+
responses:
862+
"200":
863+
$ref: '#/components/responses/OIDCInfoList'
755864

756865
security: []
757866

spec/openapi.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,9 @@ paths:
203203
'/authn-oidc/{service_id}/{account}/authenticate':
204204
$ref: 'authentication.yml#/components/paths/OIDCAuthenticate'
205205

206+
'/authn-oidc/{account}/providers':
207+
$ref: 'authentication.yml#/components/paths/ListOIDCAuthenticators'
208+
206209
'/authn-jwt/{service_id}/{account}/authenticate':
207210
$ref: 'authentication.yml#/components/paths/JWTAuthenticate'
208211

0 commit comments

Comments
 (0)