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

OAuth2 SSO Login Broken #264

Closed
legoguy1000 opened this issue Apr 8, 2020 · 0 comments
Closed

OAuth2 SSO Login Broken #264

legoguy1000 opened this issue Apr 8, 2020 · 0 comments
Labels
Milestone

Comments

@legoguy1000
Copy link

Request Type

Bug

Work Environment

Question Answer
OS version (server) Redhat
OS version (client) 7
Cortex version / git hash 3.0.0
Package Type Docker
Browser type & version Chome (latest)

Problem Description

I am setting up SSO login using OAuth2. I am using Keycloak as my IdP. When Cortex tries to exchange a code for a token, Keycloak returns a 400 Bad Request.

[error] o.t.c.s.OAuth2Srv - unexpected response from server: 400 <html><head><title>Error</title></head><body>Bad Request</body></html> [error] o.e.s.a.MultiAuthSrv - Authentication failure org.elastic4play.AuthenticationError: unexpected response from server

Steps to Reproduce

  1. Configure SSO and OAuth2 with Keycloak as the IdP
  2. Try to login

Possible Solutions

From my testing this line appears to be the problem, https://github.com/TheHive-Project/Cortex/blob/master/app/org/thp/cortex/services/OAuth2Srv.scala#L83. I have Hive SSO working and this is the only difference that I can see. Furthermore, when i use postman to send a POST request to the token endpoint with the "Accept: code" header, i get the 400 error. When I remove the Accept header, i receive the proper response.

@legoguy1000 legoguy1000 changed the title SSO Login Broken OAuth2 SSO Login Broken Apr 8, 2020
@nadouani nadouani added the bug label May 29, 2020
@nadouani nadouani added this to the 3.1.0-RC1 milestone May 29, 2020
To-om added a commit that referenced this issue Aug 12, 2020
@To-om To-om closed this as completed Aug 12, 2020
To-om added a commit that referenced this issue Aug 13, 2020
nadouani added a commit that referenced this issue Oct 28, 2020
nadouani added a commit that referenced this issue Oct 28, 2020
nadouani added a commit that referenced this issue Oct 28, 2020
To-om pushed a commit that referenced this issue Oct 28, 2020
To-om pushed a commit that referenced this issue Oct 28, 2020
To-om pushed a commit that referenced this issue Oct 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants