Help implementing a custom CredentialProvider

73 views
Skip to first unread message

Francis Augusto Medeiros-Logeay

unread,
Sep 6, 2025, 4:45:33 AMSep 6
to 'Thomas Darimont' via Keycloak User
Hi,

I would like to implement a CredentialModel/Provider. 

What I’ve done so far works pretty fine, but I can’t get it to display on the Account UI.

I am not sure what it takes to get it displayed there. I have implemented my metadata like this: 

public CredentialTypeMetadata getCredentialTypeMetadata(CredentialTypeMetadataContext credentialTypeMetadataContext) {
return CredentialTypeMetadata.builder()
.type(getType())
.category(CredentialTypeMetadata.Category.
TWO_FACTOR)
.displayName(
«My superduper credential")
.helpText("
SuperDuperTwo-Factor authentication")
.iconCssClass(
"kcAuthenticatorOTPClass")
.createAction(SuperDuperRequiredAction.
PROVIDER_ID)
.removeable(
true)
.build(
session);

I have noticed that using the example on the Keycloak-quistarter (The famous «SecretQuestion») also doesn’t get it displayed on the Account UI, though it does get it displayed on the User interface on the admin menu when the credential is configured.

What can I be possibly missing here?

Best,
Francis 





-- 
Francis Augusto Medeiros-Logeay
Oslo, Norway

Francis Augusto Medeiros

unread,
Sep 6, 2025, 5:42:14 AMSep 6
to Francis Augusto Medeiros-Logeay, 'Francis Augusto Medeiros-Logeay' via Keycloak User
Never mind, I found out! :) 

Best,
Francis

--
You received this message because you are subscribed to the Google Groups "Keycloak User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to keycloak-use...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/keycloak-user/6EFB5D09-AFDF-44BB-A53E-0DFF97E017AF%40med-lo.eu.

Thomas Darimont

unread,
Sep 6, 2025, 6:54:16 AMSep 6
to Francis Augusto Medeiros, Francis Augusto Medeiros-Logeay, 'Francis Augusto Medeiros-Logeay' via Keycloak User
Hello Francis,

Great that you could solve this on your own.
Would you mind sharing what you missed? This might help others in the future who have the same problem.

Cheers,
Thomas

Francis Augusto Medeiros

unread,
Sep 6, 2025, 7:08:30 AMSep 6
to Thomas Darimont, 'Francis Augusto Medeiros-Logeay' via Keycloak User
Thanks, I should have done it when I first wrote.

The getReferenceCategory() method was missing from the AuthenticatorFactory. I was thrown off this because, on the example of the Keycloak-Quickstarts, the value configured there is different than that of the CredentialModel. 

So when you have consequent ID’s on the CredentialModel/Provider and on the getReferenceCategory(), things work.

My last struggle is how to use my own credentials store. It seems that Keycloak is bound to fetch credentials from the database. Is that correct?

Best,
Francis
Reply all
Reply to author
Forward
0 new messages