-
Notifications
You must be signed in to change notification settings - Fork 3
/
authorization.yaml
226 lines (223 loc) · 8.05 KB
/
authorization.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
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
openapi: 3.0.0
info:
title: Europace Authorization API
description: The authorization-api can be requested to get an access-token from registered clients with client-credential-flow to use the Europace APIs.
version: '1.0'
termsOfService: 'https://docs.api.europace.de/nutzungsbedingungen/'
contact:
name: Europace AG
url: 'https://docs.api.europace.de/'
email: [email protected]
servers:
- url: 'https://api.europace.de/auth'
description: production server
paths:
/token:
post:
summary: login
description: Client-id and client-secret must be passed via HTTP Basic Auth.
parameters:
- schema:
type: string
default: mytraceid123
in: header
name: X-TraceId
description: your string for debugging
- schema:
type: string
default: application/x-www-form-urlencoded
in: header
name: Content-Type
description: ''
required: true
security:
- basicAuth: []
requestBody:
content:
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/loginRequest'
examples:
client-credential-flow:
value:
grant_type: client_credentials
client-credential-flow impersionation:
value:
grant_type: client_credentials
scope: no-access impersonieren
subject: ABC12
actor: XYZ54
auth-code-flow:
value:
grant_type: code
code: zJ0UhYgeOPInCons
redirect: 'https://myFinanceApp.com/oidc'
description: ''
tags:
- Auth
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/loginResponse'
'400':
description: Bad Request. e.g. not existing scopes requested
content:
application/json:
schema:
$ref: '#/components/schemas/error'
examples:
kein grant_type angegeben:
value:
error_description: 'Invalid request: Missing "grant_type" parameter'
error: invalid_request
Actor nicht gefunden:
value:
error_description: 'Unauthorized client: Actor not found'
error: unauthorized_client
falschen Scope angefordert:
value:
error_description: 'Invalid, unknown or malformed scope'
error: invalid_scope
'401':
description: Unauthorized. Client credentials authorization error
content:
application/json:
schema:
$ref: '#/components/schemas/error'
examples:
Autorisierungsfehler:
value:
error_description: 'Client authentication failed: Client id unknown / deactivated or client secret invalid / expired.'
error: invalid_client
'429':
description: Too Many Requests. Rate limit exceeded.
'500':
description: Internal Server Error. Ooops.
'503':
description: Service Unavailable
operationId: createToken
parameters: []
components:
securitySchemes:
basicAuth:
type: http
scheme: basic
schemas:
loginResponse:
title: loginResponse
type: object
description: |-
Response of a succesful login.
When authentication-code-flow: the additional id_token with user-information will be delivered
x-examples:
client_credential_flow:
access_token: I6MTU3...wet46
token_type: Bearer
expires_in: 3600
scope: no-access
client_credential_flow_impersonation:
access_token: I6MTU3...wet46
token_type: Bearer
expires_in: 3600
scope: no-access impersonate
authentication_code_flow:
access_token: I6MTU3...wet46
token_type: Bearer
id_token: I6MTU3...dry46
expires_in: 3600
scope: no-access openid profile
properties:
access_token:
type: string
description: Access token for use as a bearer token in the Europace APIs.
token_type:
type: string
default: BEARER
description: Type of Token (BEARER)
expires_in:
type: integer
description: Validity period in seconds
scope:
type: string
description: 'Valid scopes of the access token to know, what is possible for your app.'
id_token:
type: string
description: id_token contains authenticated sub and if scope=profile the user_profile information
required:
- access_token
- token_type
- expires_in
- scope
loginRequest:
title: loginRequest
type: object
description: |-
Parameters for the login.
When client-credential-flow: only `grant_type=client_credential` required.
When authentication-code-flow: `grant_type=code`, `code` and `redirect` are required.
When client-credential-flow with impersonation: `subject`, `actor` and `impersonate` as `scope` as well as all other required scopes must be specified.
x-examples:
client_credential_flow:
grant_type: client_credentials
authentication_code_flow:
grant_type: code
code: zJ0UhYgeOPInCons
redirect: 'https://myFinanceApp.com/oidc'
client_credential_flow_impersonation:
grant_type: client_credentials
scope: no-access impersonieren
subject: ABC12
actor: XYZ54
properties:
grant_type:
type: string
default: client_credentials
description: Must be `client_credentials` for the client-credentials-flow and `code` for the authenticaton-code-flow.
enum:
- client_credentials
- code
scope:
type: string
default: no-access impersonieren
description: 'space-separated list of scopes. Only used if the grant_type is client_credentials. If a subject is specified, imperson ate must be included as a scope. Requested scopes are restricted according to the actor''s permissions and the client''s approval by the actor. It is possible to request restricted access by specifying specific scopes. A scope represents an authorization to perform actions on the platform. If no scopes are requested, the scope is derived from the scopes stored during client registration. The currently available scopes are maintained in an overview.'
subject:
type: string
description: Partner id of the partner on whose behalf the client acts. The subject must be subordinate to the actor.
minLength: 5
maxLength: 5
example: ABC12
actor:
type: string
description: 'Partner id of the partner on whose behalf the client is acting, there must be a client approval of the actor for the client.'
minLength: 5
maxLength: 5
example: XYZ54
code:
type: string
example: zJ0UhYgeOPInCons
minLength: 16
maxLength: 16
description: code transfered to your registered callback uri
redirect_uri:
type: string
format: uri
description: your registered and requested callback uri what is redirected after user authentication process
required:
- grant_type
error:
title: error
type: object
properties:
error_description:
type: string
error:
type: string
required:
- error_description
- error
description: Content error message in addition to HTTP error code.
tags:
- name: Auth