0
votes

Am trying to get access-token from keycloak using postman application. The flow which I am using is Auth Code flow. The Auth URI am giving is

http://localhost:8080/auth/realms/realm_name/openid-connect/token

Even in keycloak I made some changes of valid redirect URI to http://localhost:8080/* in the Security-admin-console under clients but still am receiving a web page stating we are sorry instead of login page when am hitting the get request token button in postman application

can someone help me with this issue

1
The correct URL is https://AUTH_DOMAIN/auth/realms/REALM_NAME/protocol/openid-connect/tokenVadim Ashikhman

1 Answers

0
votes

Getting accessToken in Postman:

POST http://localhost:8080/auth/realms/realm-name/protocol/openid-connect/token

Headers:

Content-Type: application/x-www-form-urlencoded

Body x-www-form-urlencoded:

client_id: your-client

username: user-you-are-using

password: password-for-user

grant_type: password

client_secret: 11112222-3333-4444-5555-666666666666 (client secret is required if client "Access Type"="confidential")

Getting refreshToken in Postman:

POST http://localhost:8080/auth/realms/realm-name/protocol/openid-connect/token

Headers:

Content-Type: application/x-www-form-urlencoded

Body x-www-form-urlencoded:

client_id: your-client

grant_type: refresh_token

refresh_token: refresh-token-from-previous-request

client_secret: 11112222-3333-4444-5555-666666666666 (client secret is required if client "Access Type"="confidential")