8000 Document provided ProtocolMapper implementations by ryanemerson · Pull Request #47331 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

Document provided ProtocolMapper implementations - #47331

Merged
stianst merged 1 commit into
keycloak:mainfrom
ryanemerson:47330/protocol_mapper_docs
May 11, 2026
Merged

stianst merged 1 commit into
keycloak:mainfrom
ryanemerson:47330/protocol_mapper_docs

Conversation

@ryanemerson
@ryanemerson ryanemerson commented Mar 20, 2026 • < 8000 /div>
Copy link
Copy Markdown
Contributor

Closes #47330

Website sample:
2026-03-20T12:21:11,544758806+00:00

@ryanemerson
ryanemerson requested a review from stianst March 20, 2026 12:40
@ryanemerson
ryanemerson force-pushed the 47330/protocol_mapper_docs branch from d2b346a to c88f534 Compare March 20, 2026 17:37
@ryanemerson
ryanemerson marked this pull request as ready for review March 23, 2026 09:41
@ryanemerson
ryanemerson requested a review from a team as a code owner March 23, 2026 09:41
@stianst stianst self-assigned this Mar 23, 2026
@ryanemerson
ryanemerson force-pushed the 47330/protocol_mapper_docs branch from c88f534 to 01e6548 Compare April 30, 2026 17:20
@ryanemerson
Copy link
Copy Markdown
Contributor Author

Updated so that we now have a ProtocolMapper index table at the start of the page, grouped by protocol, which then links to the detailed configuration summary found later in the page.

image

@ahus1
ahus1 commented Apr 30, 2026
Copy link
Copy Markdown
Member

Putting on the head of a technical write: Who is the intended reader of the document: If it is a regular admin that would configure Keycloak, we usually avoid internal tech speak like SPIs, and focus on the configuration and the behavior one can achieve.

The almost only place where we talk about SPIs is the server developer guide - https://www.keycloak.org/docs/latest/server_development/index.html

So I ask: Please state the audience in this issue, and possibly in a comment in the index.adoc so people know who they are writing for.

The "Keycloak Admin API Guide" is a completely new "book". As someone involved with downstream docs I ask: Will this guide be available downstream?

@ryanemerson
ryanemerson commented May 1, 2026 •
Copy link
Copy Markdown
Contributor Author

Putting on the head of a technical write: Who is the intended reader of the document: If it is a regular admin that would configure Keycloak, we usually avoid internal tech speak like SPIs, and focus on the configuration and the behavior one can achieve.

The intended audience of the document is both an Admin and a Developer.

Currently there is no way for Keycloak admins or developers to know what ProtocolMapper implementations Keycloak provides without either:

  • Starting the UI
  • Inspecting the src

Unfortunately the latter is necessary in order to determine what config properties an implementation expects if they want to define things decoratively in a realm JSON or use an admin client/REST APIs.

The idea of this document is to document the implementations available and the expected configuration, to save both admins and developers having to go through this exercise.

I mentioned SPIs as I wanted it to be clear to developers that they can provide their own implementation if an existing one does not match their requirements. I should maybe make this more explicit. WDYT to having a sub-section of the introduction aimed specifically at developers that explains this?

The "Keycloak Admin API Guide" is a completely new "book". As someone involved with downstream docs I ask: Will this guide be available downstream?

The plan was to start with upstream and evaluate downstream later. We had discussed that this book may contain additional guides in the future for other components whose capabilities/config we do not currently document, e.g. IdentityProviderMapper

available in `ProtocolMapperRepresentation.config` for each `ProtocolMapper` implementation.

[discrete]
== Index
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.

Maybe Overview would be better than Index?

<#assign mappers = ctx.protocolMappers.getMappersByProtocol(["openid-connect", "oid4vc", "saml", "docker-v2"]) />
<#list mappers as protocol, categoryMap>

=== ${protocol}
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.

Suggested cha 10000 nge
=== ${protocol}
== ${protocol}

Protocol ends up as h3, which is the same as mapper names:

Image

@ahus1
ahus1 commented May 8, 2026
Copy link
Copy Markdown
Member

Currently there is no way for Keycloak admins or developers to know what ProtocolMapper implementations Keycloak provides without either inspect the source or the API

As people can provide their own implementations, I'd rather provide an API endpoint that provides the metadata and displays it in the admin UI. The functionality where to find it is then documented in the server administration guide. That at least my opinion.

If you start a new book here, that will have some knock-on efforts to publish that downstream, so I wouldn't start it unless there is a lot more content to come.

When creating a `ProtocolMapperRepresentation`, the `config` field is a key-value map whose available entries
depend on the specific mapper type. This page serves as a reference for the expected configuration options
available in `ProtocolMapperRepresentation.config` for each `ProtocolMapper` implementation.

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.

Would be good to include an example here

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.

Updated to include two examples 1) raw JSON payload 2) Java admin client ProtocolMapperRepresentation.

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

Looks very good to me; I've added a few small suggestions

@stianst
stianst commented May 8, 2026 •
Copy link
Copy Markdown
Contributor

Currently there is no way for Keycloak admins or developers to know what ProtocolMapper implementations Keycloak provides without either inspect the source or the API

As people can provide their own implementations, I'd rather provide an API endpoint that provides the metadata and displays it in the admin UI. The functionality where to find it is then documented in the server administration guide. That at least my opinion.

If you start a new book here, that will have some knock-on efforts to publish that downstream, so I wouldn't start it unless there is a lot more content to come.

Whole point here is to not have to use the Admin UI to use the Admin APIs. Once we have the pattern for this it will be relatively easy to add for other things like client scopes, identity providers, user federation, etc..

We should also move the Admin API documentation link to this section rather than https://www.keycloak.org/documentation.

Once we have sufficient enough stuff in this guide we can consider publishing it downstream, but for now I would consider this upstream only.

Just to add, with fairly little effort @ryanemerson has been able to quickly generated fairly good documentation around protocol mappers, which is a lot better way to discover protocol mappers as well as understanding how to create protocol mappers through the Admin APIs than what folks currently have to do with using the Admin UI and reverse engineering the JSON from there.

@ahus1
ahus1 commented May 8, 2026
Copy link
Copy Markdown
Member

Ok, then let's process, I will not block it.

@ryanemerson
ryanemerson force-pushed the 47330/protocol_mapper_docs branch from 0073d95 to dcc1f6d Compare May 8, 2026 10:07
@ryanemerson
Copy link
Copy Markdown
Contributor Author

All comments addressed. Once this PR is merged I will create a PR for the website as we need to add the new guide section:

diff --git a/guides.yaml b/guides.yaml
index 12712ee..972ba14 100644
--- a/guides.yaml
+++ b/guides.yaml
@@ -15,6 +15,8 @@ guides:
     title: UI Customization
   - id: migration
     title: Migration
+  - id: admin-api
+    title: Admin API

|===
</#if>

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

I'd remove this; the headers and tables creates a natural break; there's no need for the horizontal lines:

Image

grouped by the associated protocol.


.ProtocolMapper Overview
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.

I'd remove the footer on this table as well:

Image


|===

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

I'd remove this; headers and tables create a natural break anyways, this just looks messy ;)

Closes keycloak#47330

Signed-off-by: Ryan Emerson <remerson@ibm.com>
Co-authored-by: Stian Thorgersen <stianst@gmail.com>
@ryanemerson
ryanemerson force-pushed the 47330/protocol_mapper_docs branch from 7d86942 to 578db40 Compare May 11, 2026 08:58
@stianst
stianst enabled auto-merge (squash) May 11, 2026 10:14
@stianst
stianst merged commit e977267 into keycloak:main May 11, 2026
91 checks passed
@stianst stianst mentioned this pull request Jun 1, 2026
sashyo pushed a commit to tide-foundation/keycloak-IGA that referenced this pull request Jul 20, 2026
Closes keycloak#47330

Signed-off-by: Ryan Emerson <remerson@ibm.com>
Co-authored-by: Stian Thorgersen <stianst@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document provided ProtocolMapper implementations

3 participants

0