How to get access_token after login

HI all,

new player with Keycloak.
After authenticating, I expected to get the access_token in the cookies, but instead of that I have a KEYCLOAK_IDENTITY, KEYCLOAK_SESSION, AUTH_SESSION_ID and some others.

None of them is the access_token, and didn’t find a way to get a token by using for example the KEYCLOAK_IDENTITY token.

It is for sure not an issue in Keycloak, but something i’m missing.

Thanks for any help.

You wont get access_token in the cookies.

You could use this postman screen as a reference to get the access token

1 Like

Thanks for your reply.

This clear for me that I can request the access token using specific POST. I was expecting to get it back after user logged-in.
So, after successful login, how to request it ? I cannot use the same POST as you shown me because the user credentials are not known.
For example, I want to use NGinx to redirect requests that are not authenticated, then after user authenticated the user will be redirected to the original requested endpoint, and the cookies will include the access token, or at least the token ID.

I am having the same issue, can please let me update here if you have solved this issue.
Also, suggest I have to take different path to achieve.

I am using Social login too.

@yaakov-berkovitch Hi ,
you got any soultion for your qustion. i am working angualr 9, here also i am stucked. and one more thing how can redierct to another page “http://localhost:4200/#/dashboard” when i am adding this url keycloak dashbord clients “Valid Redirect URIs” feild throwing validation error. please let me know you have any solution for this.

Thanks and regards
Mathew

I put openresty in the middle that did it all for me, using lua script that was written to interact with OpenID servers. Very simple solution and also elegant. Your code is cleaner, and don’t deal with oaith2/openiD protocol in your application.

Hi, did you find a solution for this?