Support SSF Receivers with Push Delivery#43950
Support SSF Receivers with Push Delivery#43950thomasdarimont wants to merge 30 commits intokeycloak:mainfrom
Conversation
|
TODOs:
Backlog:
|
Usage example with caep.devSSF Stream setup with caep.devRegister with https://caep.dev to obtain an SSF transmitter access token:
Create a SSF Stream on caep.dev
Create a stream request with caep.devUse the provided access token as In the following I use the Keycloak realm POST https://ssf.caep.dev/ssf/streams
Authorization: Bearer {{transmitterToken}}
Content-Type: application/json
{
"delivery": {
"method": "urn:ietf:rfc:8935",
"endpoint_url": "{{pushEndpointUrl}}",
"authorization_header": "{{pushAuthHeader}}"
},
"events_requested": [
"https://schemas.openid.net/secevent/caep/event-type/session-revoked",
"https://schemas.openid.net/secevent/caep/event-type/credential-change",
"https://schemas.openid.net/secevent/caep/event-type/device-compliance-change",
"https://schemas.openid.net/secevent/caep/event-type/token-claims-change",
"https://schemas.openid.net/secevent/caep/event-type/assurance-level-change"
],
"description": "This field is optional. Remove this field if not needed."
}This will yield a 201 Created response like this: Now our stream is created and we can start sending events to it. Bit first we need to create a Create a SSF Receiver in Keycloak
Demo
In the server log you should see log messages like this: |
098ac04 to
998edb6
Compare
fa479a4 to
27de092
Compare
4c289f8 to
fd5db12
Compare
fd5db12 to
9be27de
Compare
9be27de to
b6069fe
Compare
70628a7 to
cfdd345
Compare
eb3b188 to
af62fab
Compare
|
Rebased to work around problems fixed in main that made CI fail |
160df3a to
c6c52cd
Compare
mabartos
left a comment
There was a problem hiding this comment.
@thomasdarimont Looks very nice! Just briefly looked at it and spotted one missing place to have the provider enabled/disabled based on the feature.
8d569e9 to
9f92d86
Compare
Unreported flaky test detectedIf the flaky tests below are affected by the changes, please review and update the changes accordingly. Otherwise, a maintainer should report the flaky tests prior to merging the PR. org.keycloak.testsuite.forms.VerifyProfileTest#testRequiredOnlyIfUserKeycloak CI - Forms IT (chrome) |
|
@thomasdarimont Thank you very much for this PR, I think it's a highly valuable feature for Keycloak, and your work is greatly appreciated. From my perspective, it may be beneficial to focus on delivering a well-defined MVP so that we can share it with the community sooner and gather early feedback. This could help us iterate more effectively based on real-world input. Do you currently have a timeline in mind for this PR? Are you considering including this experimental feature in the Keycloak 26.6 release? Please also let us know if there is anything the SIG can do to support you |
9f92d86 to
3f41d41
Compare
|
@thomasdarimont Apologies for the follow-up. I genuinely believe this is a valuable feature and would be a great addition to the Keycloak 26.6 release. That said, I completely understand that you may have many other priorities and commitments, and I don’t want to add any pressure. I just wanted to mention that, in case it was unintentional, switching the PR from draft to a regular PR might help bring a bit more visibility and attract attention from other maintainers or interested parties/contributors. |
3f41d41 to
33a5bfa
Compare
- Represent SSF Receivers as Identity Providers in Admin UI - Gradually move from SsfReceiverModel to SsfReceiverProviderConfig - Move to external stream management model (streams are created outside of Keycloak) - Move verification functionality to SsfReceiverProvider - Make SsfReceiverManager obsolete Signed-off-by: Thomas Darimont <[email protected]>
Signed-off-by: Thomas Darimont <[email protected]>
Signed-off-by: Thomas Darimont <[email protected]>
Signed-off-by: Thomas Darimont <[email protected]>
- Removed SCIM Events (which are still in draft status https://www.ietf.org/archive/id/draft-ietf-scim-events-16.html) - Revised JSON deserialization of SSF events (result is now SsfEvent instead of Map<String,Object>) - Introduced StreamEvent base class for SSF Stream events - Remove unnecessary methods Signed-off-by: Thomas Darimont <[email protected]>
- Rename SsfSpi to SsfReceiverSpi - Rename SsfReceiverProvider to SsfRegistrationProvider - Rename SsfProvider to SsfReceiverProvider This allows us to add SSF Transmitter support independently of the SSF Receiver support Signed-off-by: Thomas Darimont <[email protected]>
Signed-off-by: Thomas Darimont <[email protected]>
Signed-off-by: Thomas Darimont <[email protected]>
- Move issuer/audience validation into DefaultSsfEventProcessor - Simplify SsfPushDeliveryResource - Validate SecurityEventToken type Signed-off-by: Thomas Darimont <[email protected]>
Signed-off-by: Thomas Darimont <[email protected]>
Signed-off-by: Thomas Darimont <[email protected]>
Signed-off-by: Thomas Darimont <[email protected]>
Signed-off-by: Thomas Darimont <[email protected]>
…ings Signed-off-by: Thomas Darimont <[email protected]>
…ings Signed-off-by: Thomas Darimont <[email protected]>
Signed-off-by: Thomas Darimont <[email protected]>
Signed-off-by: Thomas Darimont <[email protected]>
- Use constant time check for authHeader - Throw SecurityEventTokenParsingException in case of invalid signatures - Add missing null checks Signed-off-by: Thomas Darimont <[email protected]>
- Revise misstyped classname Signed-off-by: Thomas Darimont <[email protected]>
- Add missing null check for TransmitterTokenType Signed-off-by: Thomas Darimont <[email protected]>
- Fix inconsistent error messages - Fix inconsistent status codes - Fix missing transmitter token type handling Signed-off-by: Thomas Darimont <[email protected]>
- Fix inconsistent error messages - Fix inconsistent status codes - Fix missing transmitter token type handling Signed-off-by: Thomas Darimont <[email protected]>
Signed-off-by: Thomas Darimont <[email protected]>
SSF Receivers can now select between a "static token" or "client credentials" authentication method to access an SSF Transmitter. Signed-off-by: Thomas Darimont <[email protected]>
Move realm access to SsfEventContext. Signed-off-by: Thomas Darimont <[email protected]>
Add support for user lookups via iss/sub based on Identity provider links. Signed-off-by: Thomas Darimont <[email protected]>
- Check if ssf profile is enabled. Signed-off-by: Thomas Darimont <[email protected]>
701a6a8 to
81ac8b4
Compare
|
This PR is superseded by #48254 |
This PR adds initial support for Shared Signals Framework with Security Event Token (SET) Push Delivery using HTTP.
Users can manage SSF Receiver components within a realm that can be connected with a SSF Transmitter.
The SSF Transmitter can send SETs (Security Event Tokens) via HTTP Push to an endpoint exposed by the Keycloak realm. A new SsfEventListener SPI can be used to react on received SSF events from a SET.
This PR assumes SSF Streams to be registered outside of Keycloak. A SSF Receiver in Keycloak is associated with a stream by configuring the StreamId, Audience and SSF Transmitter Access token in the SSF Receiver configuration.
There can be multiple logical SSF Receivers defined within a realm that can handle SET events via a
SsfEventListener.Fixes #43614

Signed-off-by: Thomas Darimont [email protected]