8000 KEYCLOAK-17936 FAPI-CIBA : support Signed Authentication Request by tnorimat · Pull Request #8006 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

KEYCLOAK-17936 FAPI-CIBA : support Signed Authentication Request - #8006

Merged
mposolda merged 1 commit into
keycloak:masterfrom
Hitachi:KEYCLOAK-17936
Jun 29, 2021
Merged

mposolda merged 1 commit into
keycloak:masterfrom
Hitachi:KEYCLOAK-17936

Conversation

@tnorimat
@tnorimat tnorimat commented May 6, 2021 •
Copy link
Copy Markdown
Contributor

This PR is for KEYCLOAK-11846 OpenID Connect Financial-grade API: Client Initiated Backchannel Authentication Profile, also is the part of the project FAPI-CIBA(poll mode) of FAPI-SIG activity.

Based on the merged OIDC CIBA feature, this PR provides additional feature to satisfy FAPI-CIBA(poll mode) security profile. KEYCLOAK-17936 FAPI-CIBA : support Signed Authentication Request describes it more.

@tnorimat
tnorimat commented May 6, 2021
10000 Copy link
Copy Markdown
Contributor Author

@mposolda This PR is for supporting FAPI-CIBA security profile support based on the merged OIDC CIBA feature as mentioned in the 17th FAPI-SIG meeting. Could you or your team review it?

@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.

@tnorimat Thanks for the PR!

I've added one inline comment regarding signature algorithms. Also I have few other comments:

  • It will be nice that ClientPolicyExecutor SecureRequestObjectExecutor is triggered somehow for the CIBA Authentication request. Similarly SecureSigningAlgorithmExecutor (or other executor) will be probably nice to be triggered to makes sure that for the FAPI, the secured algorithms are used. But I am not sure whether to integrate with client policies here or in separate PR. Maybe it makes sense to rather use separate PR for this? As I suppose it will require to have the CIBA Authorization request event available as the type of ClientPolicyEvent, which is not yet available.

assertEquals(oidcConfig.getBackchannelAuthenticationEndpoint(), oauth.getBackchannelAuthenticationUrl());
assertContains(oidcConfig.getGrantTypesSupported(), OAuth2Constants.CIBA_GRANT_TYPE);
Assert.assertNames(oidcConfig.getBackchannelTokenDeliveryModesSupported(), "poll");
Assert.assertNames(oidcConfig.getBackchannelAuthenticationRequestSigningAlgValuesSupported(), "none", Algorithm.PS256, Algorithm.PS384, Algorithm.PS512, Algorithm.RS256, Algorithm.RS384, Algorithm.RS512, Algorithm.ES256, Algorithm.ES384, Algorithm.ES512, Algorithm.HS256, Algorithm.HS384, Algorithm.HS512);
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.

Question: The specification https://openid.net/specs/openid-client-initiated-backchannel-authentication-core-1_0.html#rfc.section.7.1.1 mentions

The JWT MUST be secured with an asymmetric signature and follow the guidance from Section 10.1 of [OpenID.Core] regarding asymmetric signatures.

Not sure if it is expected that algorithms like HS* are used here?

My understanding is, that none also should not be allowed here? Section 7.1.1 title is explicitly "Signed authentication request", but with none, request is in fact not signed at all.

If I am correct, is it ok to add tests that unsigned request will fail? And the test that HS256 signed request will fail (if it makes sense to have such test)?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@mposolda Yes, that's right.
I would like to revise this PR as follows.

  • none is not allowed. keycloak returns an error if CD(client) sends backchannel authentication requests with not signed authentication request.
  • ES*, PS* and RS* are allowed. keycloak returns an error if CD(client) sends backchannel authentication requests with signed authentication request by HS*.
  • add arquillian integration tests to check the things just mentioned above.

By the way, FAPI-CIBA does not allow RS*. I would like to implement the PR for extending some existing executors to meet the requirements by FAPI-CIBA.

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.

+1 to everything you mentioned in the last paragraph. We can allow RS* by default, but reject it with the client policy executor similarly like we're doing for other use-cases where RS* is rejected by the executor.

@mposolda mposolda added priority/important Must be worked on very soon status/in-review area/oidc OpenID Connect / OAuth 2.0 — tokens, endpoints, scopes, DCR, PAR, DPoP labels Jun 24, 2021
@tnorimat
tnorimat commented Jun 25, 2021 •
Copy link
Copy Markdown
Contributor Author

@mposolda

As you said in #8006 (review) , I've been preparing the PR extending client policies to treat requests on Backchannel Authentication Endpoint.

Also, I've been preparing the PR extending some existing executors to meet the requirements by FAPI-CIBA .

Therefore, I would like to work as follows.

  1. Revising this PR as KEYCLOAK-17936 .
  2. After (1)'s PR is merged, implementing PR for extending client policies to treat requests on Backchannel Authentication Endpoint based on (1)'s PR as KEYCLOAK-17937 .
  3. After (2)'s PR is merged, implementing PR for extending some existing executors to meet the requirements by FAPI-CIBA based on (1) and (2)'s PR as KEYCLOAK-18123 .

WDYT?

@tnorimat
tnorimat commented Jun 25, 2021 •
Copy link
Copy Markdown
Contributor Author

@mposolda
Aside from it, how about extending client policies to treat requests on Device Authorization Endpoint? If you agree with it, I would like to implement PR for it.

@mposolda
Copy link
Copy Markdown
Contributor

+1 to the stages you proposed here. Also +1 for the Device Authorization Endpoint

@mposolda
Copy link
Copy Markdown
Contributor

@tnorimat I've opened the pull request Hitachi#3 to update this pull request. I've added method "isAsymmetricAlgorithm" on SignatureProvider class to be able to filter algorithms programatically instead of having hardcoded filtering of concrete provider. Hardcoded filtering may not reliably work for example for the case if someone adds new symmetric algorithm providers in the future etc. If you are fine with this, feel free to merge my PR to your branch (which should effectively update this PR against Keycloak master)

Co-authored-by: Pritish Joshi <pritish@banfico.com>
Co-authored-by: mposolda <mposolda@gmail.com>
@tnorimat
Copy link
Copy Markdown
Contributor Author

@mposolda Thank you. I've merged your PR into this PR. Could you check it?

@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.

@tnorimat Thanks!

@mposolda
mposolda merged commit 57c8048 into keycloak:master Jun 29, 2021
@mposolda
Copy link
Copy Markdown
Contributor

@tnorimat FYI. I've created one minor follow-up JIRA https://issues.redhat.com/browse/KEYCLOAK-18583 . Figured that there is this unused method, which I forgot to remove in my PR...

@tnorimat
Copy link
Copy Markdown
Contributor Author

@mposolda I'll work on https://issues.redhat.com/browse/KEYCLOAK-18583 as soon as possible.

@mposolda
mposolda commented Jun 29, 2021 •
Copy link
Copy Markdown
Contributor

@tnorimat Thanks! FYI. I've also created https://issues.redhat.com/browse/KEYCLOAK-18587 . Please let me know what do you think about it and if my understanding of the specification and description of the JIRA is correct.

Also I've created https://issues.redhat.com/browse/KEYCLOAK-18588

@tnorimat
Copy link
Copy Markdown
Contributor Author

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

Labels

area/oidc OpenID Connect / OAuth 2.0 — tokens, endpoints, scopes, DCR, PAR, DPoP priority/important Must be worked on very soon

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0