Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.

Commit 2b68bba

Browse files
committed
Add TokenExchange classes based on RFC 8693
1 parent c317fd4 commit 2b68bba

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

src/oidcmsg/oauth2/__init__.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,32 @@ class TokenIntrospectionResponse(Message):
295295
}
296296

297297

298+
# RFC 8693
299+
class TokenExchangeRequest(Message):
300+
c_param = {
301+
"grant_type": SINGLE_REQUIRED_STRING,
302+
"resource": OPTIONAL_LIST_OF_STRINGS,
303+
"audience": OPTIONAL_LIST_OF_STRINGS,
304+
"scope": OPTIONAL_LIST_OF_SP_SEP_STRINGS,
305+
"requested_token_type": SINGLE_OPTIONAL_STRING,
306+
"subject_token": SINGLE_REQUIRED_STRING,
307+
"subject_token_type": SINGLE_REQUIRED_STRING,
308+
"actor_token": SINGLE_OPTIONAL_STRING,
309+
"actor_token_type": SINGLE_OPTIONAL_STRING,
310+
}
311+
312+
313+
class TokenExchangeResponse(Message):
314+
c_param = {
315+
"access_token": SINGLE_REQUIRED_STRING,
316+
"issued_token_type": SINGLE_REQUIRED_STRING,
317+
"token_type": SINGLE_REQUIRED_STRING,
318+
"expires_in": SINGLE_OPTIONAL_INT,
319+
"refresh_token": SINGLE_OPTIONAL_STRING,
320+
"scope": OPTIONAL_LIST_OF_SP_SEP_STRINGS,
321+
}
322+
323+
298324
class JWTSecuredAuthorizationRequest(AuthorizationRequest):
299325
c_param = AuthorizationRequest.c_param.copy()
300326
c_param.update({

0 commit comments

Comments
 (0)