[keycloak-user] How to get the state parm to create a valid redirect url?

Christina Lau christinalau28 at icloud.com
Tue Aug 26 14:55:11 EDT 2014


I am trying to integrate Keycloak, RestEasy and Swagger. I got most of the stuff to work with the exception of a redirect URL problem.

The scenario is if I am not yet authorized to a Restful service, then in Swagger, I can click on their authorize button and that is supposed to bring me to the Keycloak login screen. I am basically doing what is described in this article if that helps: 

http://developers-blog.helloreverb.com/enabling-oauth-with-swagger/

The problem I am facing is: It seems for Keycloak redirect to work, there is a state parameter. For example, this works:

http://localhost:8080/auth/realms/DSG_API/tokens/login?client_id=dsgapi&redirect_uri=http%3A%2F%2Flocalhost%3A8080%2Fdsgapi%2Fblueprints%2F&state=319%2F75ebc1c8-a530-4a3d-b69f-480e96b69b68&login=true

How do I programmatically get this state parameter?

Christina


More information about the keycloak-user mailing list