2016-04-06 07:43:15 +00:00
|
|
|
Example Realm REST Resource provider
|
|
|
|
====================================
|
|
|
|
|
2020-02-14 06:20:44 +00:00
|
|
|
You can deploy as a module by running:
|
2016-04-06 07:43:15 +00:00
|
|
|
|
2016-11-09 08:40:31 +00:00
|
|
|
$KEYCLOAK_HOME/bin/jboss-cli.sh --command="module add --name=org.keycloak.examples.hello-rest-example --resources=target/hello-rest-example.jar --dependencies=org.keycloak.keycloak-core,org.keycloak.keycloak-server-spi,org.keycloak.keycloak-server-spi-private,javax.ws.rs.api"
|
2016-04-06 07:43:15 +00:00
|
|
|
|
2016-09-08 12:04:12 +00:00
|
|
|
Then registering the provider by editing `standalone/configuration/standalone.xml` and adding the module to the providers element:
|
2016-04-06 07:43:15 +00:00
|
|
|
|
2016-09-08 12:04:12 +00:00
|
|
|
<providers>
|
|
|
|
...
|
|
|
|
<provider>module:org.keycloak.examples.hello-rest-example</provider>
|
|
|
|
</providers>
|
2016-04-06 07:43:15 +00:00
|
|
|
|
2016-11-11 12:30:42 +00:00
|
|
|
Then start (or restart) the server. Once started open http://localhost:8080/auth/realms/master/hello and you should see the message _Hello master_.
|
|
|
|
You can also invoke the endpoint for other realms by replacing `master` with the realm name in the above url.
|