Skip to content
Snippets Groups Projects
Verified Commit d5f4f866 authored by Ira ¯\_(ツ)_/¯'s avatar Ira ¯\_(ツ)_/¯
Browse files

Update README

parent f4d02a0d
No related branches found
No related tags found
No related merge requests found
......@@ -33,14 +33,26 @@ docker-compose up -d
## Verify the custom endpoint (master realm)
```bash
curl --request POST \
--url http://localhost:8080/auth/realms/master/mailpass/compute-password-hash \
--header 'Content-Type: application/json' \
--data '{"password": "[YM+K?dY!&28Hm5V"}'
curl -i --request POST\
--url http://localhost:8080/auth/realms/master/mailpass/roleauth/compute-password-hash\
--data "{ \"password\": \"#4e[LbY+n$yP~vmC\" }"\
--header "Content-type: application/json"\
--header "Authorization: Bearer $ACCESS_TOKEN";
```
**Note**: The custom REST endpoint only works for authenticated users as such a bearer token
is necessary.
## Testing authenticated access with provided test file
The endpoint is only accessible for authenticated users. REST request must be authenticated with bearer access token of authenticated user and the user must be in realm role admin in order to access the resource. You can run bash script from the `docker` directory:
./invoke-authenticated.sh
The script assumes user admin with password admin exists in realm master. Also it assumes that you have curl installed. **Note**: If you are testing this using the provided docker-compose sample you need to add the admin role to admin_cli client as outlined below:
![add admin role to admin-cli](./img/admin-cli-client-role.png)
## Install provider using the Keycloak Deployer
If you copy your provider jar to the Keycloak standalone/deployments/ directory, your provider will automatically be deployed. Hot deployment works too.
Need to add admin role to admin_cli client
roles/keycloak/files/providers/keycloak-mailpass-rest/img/admin-cli-client-role.png

72.9 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment