TheHive-Project / TheHive-Project/Cortex
Authentication error after migrating from 2.1.3 to 3.0.1
Nobody has claimed this yet.
- Dominant language
- Scala
- Stars
- 1.6k
- Forks
- 264
- PR merge metrics
- No merged PRs in 30d
Description
Request Type
Bug
Work Environment
| Question | Answer |
|---|---|
| OS version (server) | Ubuntu 16.04, Kubernetes 1.14 |
| OS version (client) | Windows |
| Cortex version / git hash | 2.1.3->3.0.1 |
| Package Type | Docker |
Problem Description
After changing the Docker image version to 3.0.1 and modifying the configuration according to this guide, it is not possible to login to Cortex. We are using LDAP integration, and it was working OK with the previous version. Checking the logs, there are some warnings and the attached Error. The issue seems related to Cortex not being able to perform an API request to /api/user/current.
Steps to Reproduce
- Migrate a working Cortex setup running on 2.1.3 to 3.0.1 version
Complementary information
[error] o.e.s.a.MultiAuthSrv - Authentication failure
org.elastic4play.AuthenticationError: Authentication using API key is not supported
at org.elastic4play.services.AuthSrv.authenticate(UserSrv.scala:50)
at org.elastic4play.services.AuthSrv.authenticate$(UserSrv.scala:49)
at org.elastic4play.services.auth.LdapAuthSrv.authenticate(LdapAuthSrv.scala:99)
at org.elastic4play.services.auth.MultiAuthSrv.$anonfun$authenticate$3(MultiAuthSrv.scala:58)
at org.elastic4play.services.auth.MultiAuthSrv$$anonfun$$nestedInanonfun$forAllAuthProvider$1$1.applyOrElse(MultiAuthSrv.scala:43)
at org.elastic4play.services.auth.MultiAuthSrv$$anonfun$$nestedInanonfun$forAllAuthProvider$1$1.applyOrElse(MultiAuthSrv.scala:41)
at scala.concurrent.Future.$anonfun$recoverWith$1(Future.scala:417)
at scala.concurrent.impl.Promise.$anonfun$transformWith$1(Promise.scala:41)
at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:64)
at akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:55)
[info] o.t.c.s.ErrorHandler - GET /api/user/current returned 500
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the 2.1.3 to 3.0.1 migration described in the issue and inspect the /api/user/current failure. Read UserSrv.scala, LdapAuthSrv.scala, and MultiAuthSrv.scala around the reported authentication error. Done means LDAP users can log in after migration and /api/user/current no longer returns 500.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, kubernetes, scala
- Domain
- api, authentication, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100