Skip to content

Commit

Permalink
feat(image): add token-exchange and device secret (#2788)
Browse files Browse the repository at this point in the history
  • Loading branch information
iromli authored Oct 31, 2022
1 parent db559dd commit 87c4676
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 9 deletions.
2 changes: 1 addition & 1 deletion docker-jans-persistence-loader/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ RUN python3 -m ensurepip \
# =====================

# janssenproject/jans SHA commit
ENV JANS_SOURCE_VERSION=e74ea8e27e59d35ff6e3c6f997e6c1df6a04ec83
ENV JANS_SOURCE_VERSION=3f677636cc2f871e5a9c683634334578405f18f3
ARG JANS_SETUP_DIR=jans-linux-setup/jans_setup
ARG JANS_SCRIPT_CATALOG_DIR=docs/script-catalog

Expand Down
1 change: 1 addition & 0 deletions docker-jans-persistence-loader/scripts/spanner_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,7 @@ def column_int_to_string(table_name, col_name):
("jansScope", "creatorAttrs"),
("jansScope", "creationDate"),
("jansStatEntry", "jansData"),
("jansSessId", "deviceSecret"),
]:
add_column(mod[0], mod[1])

Expand Down
1 change: 1 addition & 0 deletions docker-jans-persistence-loader/scripts/sql_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@ def column_from_json(table_name, col_name):
("jansScope", "creatorAttrs"),
("jansScope", "creationDate"),
("jansStatEntry", "jansData"),
("jansSessId", "deviceSecret"),
]:
add_column(mod[0], mod[1])

Expand Down
16 changes: 16 additions & 0 deletions docker-jans-persistence-loader/scripts/upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,14 @@ def _transform_auth_dynamic_config(conf):
]
should_update = True

for grant_type in [
"urn:ietf:params:oauth:grant-type:device_code",
"urn:ietf:params:oauth:grant-type:token-exchange",
]:
if grant_type not in conf["dynamicGrantTypeDefault"]:
conf["dynamicGrantTypeDefault"].append(grant_type)
should_update = True

if "forceSignedRequestObject" not in conf:
conf["forceSignedRequestObject"] = False
should_update = True
Expand Down Expand Up @@ -205,6 +213,14 @@ def _transform_auth_dynamic_config(conf):
}
should_update = True

for grant_type in [
"urn:ietf:params:oauth:grant-type:device_code",
"urn:ietf:params:oauth:grant-type:token-exchange",
]:
if grant_type not in conf["grantTypesSupported"]:
conf["grantTypesSupported"].append(grant_type)
should_update = True

# return the conf and flag to determine whether it needs update or not
return conf, should_update

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@
"client_credentials",
"refresh_token",
"urn:ietf:params:oauth:grant-type:uma-ticket",
"urn:ietf:params:oauth:grant-type:device_code"
"urn:ietf:params:oauth:grant-type:device_code",
"urn:ietf:params:oauth:grant-type:token-exchange"
],
"subjectTypesSupported":[
"public",
Expand Down Expand Up @@ -273,7 +274,8 @@
"client_credentials",
"refresh_token",
"urn:ietf:params:oauth:grant-type:uma-ticket",
"urn:ietf:params:oauth:grant-type:device_code"
"urn:ietf:params:oauth:grant-type:device_code",
"urn:ietf:params:oauth:grant-type:token-exchange"
],
"claimsParameterSupported":false,
"requestParameterSupported":true,
Expand Down Expand Up @@ -477,11 +479,11 @@
"templatesPath": "/ftl",
"scriptsPath": "/scripts",
"serializerType": "KRYO",
"maxItemsLoggedInCollections": 3,
"pageMismatchErrorPage": "mismatch.ftl",
"interruptionErrorPage": "timeout.ftl",
"crashErrorPage": "crash.ftl",
"finishedFlowPage": "finished.ftl",
"maxItemsLoggedInCollections": 9,
"pageMismatchErrorPage": "mismatch.ftlh",
"interruptionErrorPage": "timeout.ftlh",
"crashErrorPage": "crash.ftlh",
"finishedFlowPage": "finished.ftlh",
"bridgeScriptPage": "agama.xhtml",
"defaultResponseHeaders": {
"Cache-Control": "max-age=0, no-store"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@
"grantTypesSupported":[
"client_credentials",
"authorization_code",
"refresh_token"
"refresh_token",
"urn:ietf:params:oauth:grant-type:device_code",
"urn:ietf:params:oauth:grant-type:token-exchange"
],
"allowIdTokenWithoutImplicitGrantType": true,
"subjectTypesSupported":[
Expand Down

0 comments on commit 87c4676

Please sign in to comment.