Access the keycloak API from postman

后端 未结 5 1962
眼角桃花
眼角桃花 2020-12-31 02:40

I have tried to access the keycloak API from the postman. but it is showing 400 bad request.

I was calling api in the below format.

http://{hostname         


        
5条回答
  •  孤城傲影
    2020-12-31 03:37

    The URL you are using is to obtain the token.

    The token request should be a POST call, the request you post is a GET request. Below a CURL example about how to request the access_token

    curl -X POST \
       http://{hostname}:8080/auth/realms/{realm}/protocol/openid-connect/token \
       -H 'Content-Type: application/x-www-form-urlencoded' \
       -d 'username=admin&password=admin&grant_type=password&client_id=admin-cli'
    

提交回复
热议问题