Issue
I am planing to work on continuous delivery of my apis and backoffice js-spa applications with Azure pipelines. I am wondering how and if it is recommanded to automate also client registration for my apis on keycloack. What is the best way to automate this part of the deployment ?
Solution
As far as I know, keycloak is a local server. So in order to use keycloak , you need to create a self-hosted agent, and then you can run the CD(continous delivery) pipeline on it.
In Azure Pipeline, there is no pipeline task out of the box to support keycloak Client Registration.
You need to run the CURL script to Client Registration in PowerShell task/Bash task/Command Line task
.
Here is an example:
curl -X POST \
-d '{ "clientId": "$(myclient)" }' \
-H "Content-Type:application/json" \
-H "Authorization: bearer xxtokenxx" \
http://localhost:8080/auth/realms/master/clients-registrations/default
You could create a variable(logging command) with the client. Then you could use the variable in CURL script.
For example:
echo "##vso[task.setvariable variable=myclient;]Client content"
You could use $(myclient)
in the next task.
Answered By - Kevin Lu-MSFT Answer Checked By - Marie Seifert (PHPFixing Admin)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.