Skip to content

cURL Keycloak

Register user

curl -X post https://xxxx/auth/admin/realms/xxxx/users -H "Content-Type: application/json" -H "Authorization: Bearer xxxx" -d '
{
   "username": "xxxx",
   "firstName": "xxxx",
   "lastName": "xxxx",
   "realmRoles": [],
   "credentials": [
      {
         "type": "xxxx"
         "value": "xxxx"
      }
   ],
   "enabled": true
}'

 

Login user

curl -d 'client_id=xxxx' -d 'username=xxxx' -d 'password=xxxx' -d 'grant_type=password' 'https://xxxx/auth/realms/xxxx/protocol/openid-connect/token'
Published inSoftware Engineer

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *