Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dealing with load balancer with keycloak stateful implementation #9909

Closed
Bogad opened this issue Jun 13, 2019 · 3 comments
Closed

Dealing with load balancer with keycloak stateful implementation #9909

Bogad opened this issue Jun 13, 2019 · 3 comments
Milestone

Comments

@Bogad
Copy link

Bogad commented Jun 13, 2019

Hi @mraible
I have generated a microservice project and i chose oauth2 with Keycloak for security implemntation.

But, as you implement a stateful integration with spring security and Keycloak , how can I deal with load balancing (n instances) as i have to deploy my microservice in Kubernetes?
Can i change Keycoak integration to be stateless in order to solve this problem.

Thanks

@mraible
Copy link
Contributor

mraible commented Jun 13, 2019

Hello @Bogad. We had a long discussion about this earlier this year. To summarize: we'd like to keep the current implementation as its more secure to do authorization code flow on the server side. If you have scaling issues, we recommend replacing the session implementation in your server with something like Redis.

If you'd like to implement a stateless OAuth 2.0 flow, you could use implicit flow (but that might be dead. PKCE + authorization code flow in the browser is possible and I have it working in my Ionic for JHipster module.

If you'd like to see a stateless implementation in JWT, you can create a JHipster module. However, using a JWT as a session token is not recommended.

@mraible mraible closed this as completed Jun 13, 2019
@Bogad
Copy link
Author

Bogad commented Jun 13, 2019

Thanks @mraible for the reply
Otherwise, in stateful case i have problems with swagger giving me always 401 because no authorize button is available to obtain a token as i can do with the stateless configuration

@mraible
Copy link
Contributor

mraible commented Jun 13, 2019 via email

@jdubois jdubois added this to the 6.1.1 milestone Jun 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants