Custom Spi Rest Not working

Hi, so i need to build an extensions for the admin-rest module and i think i am done coding it.

My problem is that when i deploy it, i see it in the provider in the server info panel but can’t put a http request to it.

I tried using the example in https://github.com/zonaut/keycloak-extensions/tree/master/spi-resource
building it and deploying it to standalone/deployment and it does the same, it show in the system panel but the api is unresponsive, any trick needed to make it work ?

Hi,

I’m the owner of the zonaut link you posted, I’ve just tried it out and tested it with running the script https://github.com/zonaut/keycloak-extensions/blob/master/spi-resource/test-anonymous-user.sh and found no problems with it.

Are you sure you’re calling the correct url? Port number, realm name?

hi thanks for the answer, i just fiddled with it a bit and you did got me the solution,

it was pointing to 8088 instead of 8080 for me, and i was expecting the admin pluggin to be installed on /auth/admin/realms//customs but it’s /auth/realms/

thanks for the project I would have never figured it out otherwise.

i get an error when trying to use the test tough but that’s ok I might just need a dependency or something.

no problem, happy this can help others. Have fun.

Also when you have errors like class not found when developing extensions it’s possible you need to declare some modules global and/or dependencies you need.
Take a look at the other readme’s for the other examples, especially the Keycloak config and global-modules examples.

<global-modules>
        <module name="org.keycloak.keycloak-services"/>
</global-modules>
1 Like

i seem to have the exact problem you are mentioning. i keep getting :

Uncaught server error: java.lang.NoClassDefFoundError: org/keycloak/services/managers/AppAuthManager

and adding your snippet to

< subsystem xmlns=“urn:jboss:domain:ee:5.0”>

did the trick thank you.

now i just need to figure out why my token is ignored :rofl:

If you’re getting problems with your token it’s possible you have something wrong with the configuration of your client. Try enabling direct access grant and see if it makes a difference.
Take a look at https://github.com/zonaut/keycloak-extensions/blob/master/spi-resource/test-authenticated-user.sh and see if it contains something useful that could help you.

Good luck and have fun