[keycloak-user] Any examples for custom Identity Providers?

Alfonso Vidal García avidal at gmv.com
Thu Oct 3 02:41:26 EDT 2019


Hi,

I don’t have any more errors. Now the error that I’m having is that I don’t see the UserStorageProvider in the list in the Admin Console, and if I change the master-realm in the standalone.xml, an error ocurr with the roles of the user, so I don’t know what I am doing wrong.

I solve the error doing the manual installation, because with the hot deploy I always have the error.

From: James Mitchell [mailto:jamesm at suitebox.com]
Sent: Wednesday, October 2, 2019 10:23 PM
To: keycloak-user at lists.jboss.org
Cc: sthorger at redhat.com; Alfonso Vidal García <avidal at gmv.com>
Subject: Re: [keycloak-user] Any examples for custom Identity Providers?

Hi Stian and Alfonso,

I have not added a jboss deployment structure file. So far I have succeeded in adding customised UserStorage, PasswordHash, and a new Endpoint, and instead of deploying to a running server, I am using a Docker workflow.
First I build a jar with my code, the dependancies, and the special META_INF/services/ files.
Then I make a Docker image based on the official Keycloak image and copy my jar into the /opt/jboss/keycloak/standalone/deployments/ directory
Finally I restart the services with the new image. And everything has been working well for the last 4 months.

I'm interested that Alfonso's error is the same as mine, but for a UserStorageProvider.
That suggests very strongly that I do need to do something extra to deploy the IdentityProvider - something that my UserProvider does not need, or that I have accidentally done right :) because I do not see this error for that class.

(I have just confirmed I get the same behaviour using the v7.0.0 and the v6.0.1 Docker images)

----
James Mitchell
Developer

e: jamesm at suitebox.com<mailto:jamesm at suitebox.com>
w: www.suitebox.com<https://urldefense.proofpoint.com/v2/url?u=https-3A__www.suitebox.com&d=DwMFaQ&c=CIoxZ4z5BqFvKvSGFOTo726QZIiNTc_M9CmngT-Pla4&r=F6SAryNNUdjEYGb6lSnLGg&m=7LSV6v_p6v4G7KhWNbFYLVOAtl-vSZD36FVXOOerY2Q&s=kOORUknkqWfC9ZPewZGJJ3Le3Qbj65ERw6NoRjmYPtM&e=>

SuiteBox | Level 4, 8 Mahuhu Crescent, Auckland 1010, NZ


On Wed, 2 Oct 2019 at 19:18, Stian Thorgersen <sthorger at redhat.com<mailto:sthorger at redhat.com>> wrote:
Did you add a jboss-deployment-structure.xml with a dependency on server-private-api (or whatever it is called) module?

On Wed, 2 Oct 2019, 05:39 James Mitchell, <jamesm at suitebox.com<mailto:jamesm at suitebox.com>> wrote:
Are there any examples for customising an Identity Provider?

I want to make an extension to the OIDCIdentityProvider, so that I can
accept non-standard fields for the userinfo response. All part of trying to
get token exchange to work in our system...

I have made a light change to the OIDCIdentityProvider, and also compared
with the various social providers, and I have something that deploys.
But it throws an error at runtime trying to create the class.

This looks liek this when adding the provider in the website
UT005023: Exception handling request to
/auth/admin/realms/sbxtest/identity-provider/providers/xplan:
java.lang.NoClassDefFoundError: Failed to link
com/suitebox/keycloak/broker/xplan/XPLANIdentityProvider (Module
"deployment.sbxkeycloak.jar" from Service Module Loader):
org/keycloak/broker/oidc/AbstractOAuth2IdentityProvider

And looks like this when trying to perform token-exchange with the provider
Uncaught server error: java.lang.NoClassDefFoundError: Failed to link
com/suitebox/keycloak/broker/xplan/XPLANIdentityProvider (Module
"deployment.sbxkeycloak.jar" from Service Module Loader):
org/keycloak/broker/oidc/AbstractOAuth2IdentityProvider


----

*James Mitchell*

Developer

e: jamesm at suitebox.com<mailto:jamesm at suitebox.com>

w: www.suitebox.com<https://urldefense.proofpoint.com/v2/url?u=http-3A__www.suitebox.com&d=DwMFaQ&c=CIoxZ4z5BqFvKvSGFOTo726QZIiNTc_M9CmngT-Pla4&r=F6SAryNNUdjEYGb6lSnLGg&m=7LSV6v_p6v4G7KhWNbFYLVOAtl-vSZD36FVXOOerY2Q&s=0kl7wLsPW-JdmIwMiGOVD6D7qGiKNTog7r2dUeLACTI&e=>


*SuiteBox |* Level 4, 8 Mahuhu Crescent, Auckland 1010, NZ
_______________________________________________
keycloak-user mailing list
keycloak-user at lists.jboss.org<mailto:keycloak-user at lists.jboss.org>
https://lists.jboss.org/mailman/listinfo/keycloak-user<https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.jboss.org_mailman_listinfo_keycloak-2Duser&d=DwMFaQ&c=CIoxZ4z5BqFvKvSGFOTo726QZIiNTc_M9CmngT-Pla4&r=F6SAryNNUdjEYGb6lSnLGg&m=7LSV6v_p6v4G7KhWNbFYLVOAtl-vSZD36FVXOOerY2Q&s=x879cz6zWwF3GAgRvQTEf1wgLAVvYDmRqCXGtdY_tbc&e=>

P Please consider the environment before printing this e-mail.


More information about the keycloak-user mailing list