Rick
Rick

Reputation: 1

Keycloak Gateway: Programmatically keeping the token active

I am looking into using Keycloak to replace our in-house legacy system. I have successfully setup key cloak and can get a token but I need to keep it active. My plan is to have an action filter that can get the token from the request and call something on Keycloak to stop it from timing out. I thought by calling this:

http://localhost:8080/realms/dev/protocol/openid-connect/token/introspect

error

But as you can see this does not work, any ideas, please?

I have created a test app to call this

http://localhost:8080/realms/dev/protocol/openid-connect/token/introspect

Every 30 seconds

Upvotes: 0

Views: 804

Answers (1)

Tore Nestenius
Tore Nestenius

Reputation: 19901

You should consider using refresh token as the way to get new access token when they expire.

This blog post can be a good starting point https://huongdanjava.com/get-access-token-using-refresh-token-with-keycloak.html

Upvotes: 0

Related Questions