Skip to content

[KEYCLOAK-18630] - Request object encryption support#8243

Merged
pedroigor merged 1 commit into
keycloak:masterfrom
pedroigor:KEYCLOAK-18630
Jul 9, 2021
Merged

[KEYCLOAK-18630] - Request object encryption support#8243
pedroigor merged 1 commit into
keycloak:masterfrom
pedroigor:KEYCLOAK-18630

Conversation

@pedroigor

@pedroigor pedroigor commented Jul 5, 2021

Copy link
Copy Markdown
Contributor

Basically:

  • Enable request object encryption using asymmetric keys (only RSA for now) based on realm active keys intended for encryption use
  • When decrypting, key selection is based on either the kid or on the priority set for keys in case multiple ENC keys exist and no kid was set
  • Exposes keys for encryption use in JWKS
  • Enables both RSA-OAEP and RSA-OAEP-256 algorithms. As well as content encryption using A256GCM.
  • Changes TokenManager to deal with both JWS and JWE. It should make it easier to support encryption in other places where clients might send JWS/JWE.
  • Supports JWE and JWS+JWE.

I did not include yet any config option for clients like to force encryption for request objects or even force a specific alg/enc.

@pedroigor
pedroigor requested a review from mposolda July 5, 2021 20:10
@pedroigor
pedroigor force-pushed the KEYCLOAK-18630 branch 4 times, most recently from bacb773 to 77d98fd Compare July 6, 2021 12:49
@pedroigor pedroigor added area/oidc Indicates an issue on OIDC area kind/enhancement Categorizes a PR related to an enhancement labels Jul 6, 2021
@pedroigor
pedroigor force-pushed the KEYCLOAK-18630 branch 2 times, most recently from 594b579 to 6e3c9d8 Compare July 6, 2021 18:43

@mposolda mposolda left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pedroigor Thanks Pedro for the PR!

I've added two inline comments (possibly discussion points) to the PR.

Comment thread services/src/main/java/org/keycloak/jose/jws/DefaultTokenManager.java Outdated
Comment thread services/src/main/java/org/keycloak/jose/jws/DefaultTokenManager.java Outdated

@mposolda mposolda left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pedroigor Thanks Pedro! I am approving. I hope we can merge once tests are passing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/oidc Indicates an issue on OIDC area kind/enhancement Categorizes a PR related to an enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants