Skip to content

Commit fc549d0

Browse files
authored
Merge pull request #23 from bbockelm/id_token_qdl
Allow the id_token to be transformed by an QDL script
2 parents c1d1146 + 78aa01c commit fc549d0

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

scitokens-server/etc/templates/client-template.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<entry key="public_key">4b289478ab9e80f43a837620fd09e3484b10bb77</entry>
1212
<entry key="last_modified_ts">2022-01-19T21:39:03.254Z</entry>
1313
<entry key="rt_lifetime">1209600000</entry>
14-
<entry key="cfg">{"tokens":{"access":{"audience":"ANY","type":"sci_token","qdl": {"load": "vfs#/scripts/scitokens/policies.qdl","xmd": {"exec_phase": ["pre_auth","post_token","post_refresh","post_exchange"]}}}}}</entry>
14+
<entry key="cfg">{"tokens":{"access":{"audience":"ANY","type":"sci_token","qdl": {"load": "vfs#/scripts/scitokens/policies.qdl","xmd": {"exec_phase": ["pre_auth","post_token","post_refresh","post_exchange"]}}}, "identity": {"type": "identity", "qdl": {"load": "vfs#/scripts/scitokens/id_token_policies.qdl", "xmd": {"exec_phase": ["post_token", "post_refresh", "post_exchange"]}}} }}</entry>
1515
<entry key="proxy_limited">false</entry>
1616
<entry key="home_url">https://localhost:9443/client2</entry>
1717
<entry key="sign_tokens">true</entry>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/*
2+
Simply prefer the eppn for the subject; otherwise, pass the token through.
3+
*/
4+
5+
if[
6+
is_defined(claims.'eppn')
7+
][
8+
claims.'sub' := claims.'eppn';
9+
]else[
10+
if[
11+
is_defined(claims.'email')
12+
][
13+
claims.'sub' := claims.'email';
14+
];
15+
];

0 commit comments

Comments
 (0)