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

Commit 5609a07

Browse files
committed
Refactor token exchange configuration
1 parent b40c5bc commit 5609a07

File tree

4 files changed

+219
-161
lines changed

4 files changed

+219
-161
lines changed

docs/source/contents/conf.rst

+31-1
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,37 @@ An example::
344344
"client_secret_jwt",
345345
"private_key_jwt",
346346
],
347-
"revoke_refresh_on_issue": True
347+
"revoke_refresh_on_issue": True,
348+
"token_exchange": {
349+
"subject_token_types_supported": [
350+
"urn:ietf:params:oauth:token-type:access_token",
351+
"urn:ietf:params:oauth:token-type:refresh_token",
352+
"urn:ietf:params:oauth:token-type:id_token"
353+
],
354+
"requested_token_types_supported": [
355+
"urn:ietf:params:oauth:token-type:access_token",
356+
"urn:ietf:params:oauth:token-type:refresh_token",
357+
"urn:ietf:params:oauth:token-type:id_token"
358+
],
359+
"policy": {
360+
"urn:ietf:params:oauth:token-type:access_token": {
361+
"callable": "/path/to/callable",
362+
"kwargs": {
363+
"audience": ["https://example.com"],
364+
"resource": [],
365+
"scopes": ["abc", "def"]
366+
}
367+
},
368+
"urn:ietf:params:oauth:token-type:refresh_token": {
369+
"callable": "/path/to/callable",
370+
"kwargs": {
371+
"audience": ["https://example.com"],
372+
"resource": [],
373+
"scopes": ["abc", "def"]
374+
}
375+
}
376+
}
377+
}
348378
}
349379
},
350380
"userinfo": {

src/oidcop/configure.py

+31-1
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,37 @@ def __init__(
564564
"client_secret_basic",
565565
"client_secret_jwt",
566566
"private_key_jwt",
567-
]
567+
],
568+
"token_exchange": {
569+
"subject_token_types_supported": [
570+
"urn:ietf:params:oauth:token-type:access_token",
571+
"urn:ietf:params:oauth:token-type:refresh_token",
572+
"urn:ietf:params:oauth:token-type:id_token"
573+
],
574+
"requested_token_types_supported": [
575+
"urn:ietf:params:oauth:token-type:access_token",
576+
"urn:ietf:params:oauth:token-type:refresh_token",
577+
"urn:ietf:params:oauth:token-type:id_token"
578+
],
579+
"policy": {
580+
"urn:ietf:params:oauth:token-type:access_token": {
581+
"callable": "/path/to/callable",
582+
"kwargs": {
583+
"audience": ["https://example.com"],
584+
"resource": [],
585+
"scopes": ["abc", "def"]
586+
}
587+
},
588+
"urn:ietf:params:oauth:token-type:refresh_token": {
589+
"callable": "/path/to/callable",
590+
"kwargs": {
591+
"audience": ["https://example.com"],
592+
"resource": [],
593+
"scopes": ["abc", "def"]
594+
}
595+
}
596+
}
597+
}
568598
},
569599
},
570600
"userinfo": {

0 commit comments

Comments
 (0)