-
Notifications
You must be signed in to change notification settings - Fork 640
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
Authentication Error when using Hive API (Patch) #951
Comments
In 2 and 3 there is a ":" before the caseid. Thats wrong. |
The above : was a typo from an earlier attempt. I get the same error without :. Updated the original question to prevent further confusion. curl -v --request PATCH -H 'Authorization: Bearer: ' -H "Content-type: application/json" -d '{"resolutionStatus": "Other","summary": "auto - closed by user request(Hive API)"}' 'http://.com:9000/api/case/AWmmIanujG3xWCFBpAsG'
Same with -XPATCH |
I guess you correctly added the API key (because it is missing and not marked as repalced here)...? Did you try authentication using Basic-auth with user/Password? |
Yes to both of your questions, I also tried other APIs/making a new API key as part of the above steps. |
PATCH and POST use the same authentication check. I don't get why it could work for POST and not for PATCH |
Are you using
or
|
without the extra |
Authentication error while attempting to PATCH a case via Hive API
Request Type
Bug
Work Environment
Problem Description
Receiving a 401 non-auth when attempting to update the case via API. API key works for POST but not PATCH
Steps to Reproduce
curl -XGET -H 'Authorization: Bearer correct key' hxxp://redacted:9000/api/case/AWmmIanujG3xWCFBpAsG
curl -v -XPATCH -H 'Authorization: Bearer: correct key' -H "Content-type: application/json" -d '{"resolutionStatus": "Other","summary": "auto - closed by user request(Hive API)"}' 'hxxp://redacted.com:9000/api/case/AWmmIanujG3xWCFBpAsG'
curl -v --request PATCH -H 'Authorization: Bearer: correct key' -H "Content-type: application/json" -d '{"resolutionStatus": "Other","summary": "auto - closed by user request(Hive API)"}' 'hxxp://redacted>:9000/api/case/AWmmIanujG3xWCFBpAsG'
Possible Solutions
Unknown
Complementary information
Application Log
`2019-04-09 13:44:09,478 [ERROR] from org.elastic4play.controllers.Authenticated in application-akka.actor.default-dispatcher-17 - Authentication failure:
session: AuthenticationError User session not found
pki: AuthenticationError Certificate authentication is not configured
key: AuthenticationError Only bearer authentication is supported
init: AuthenticationError Use of initial user is forbidden because users exist in database'
'2019-04-09 13:44:09,479 [INFO] from org.elastic4play.ErrorHandler in application-akka.actor.default-dispatcher-17 - PATCH /api/case/:AWmmIanujG3xWCFBpAsG returned 401
org.elastic4play.AuthenticationError: Authentication failure
at org.elastic4play.controllers.Authenticated.$anonfun$getContext$4(Authenticated.scala:261)
at scala.concurrent.Future.$anonfun$flatMap$1(Future.scala:303)
at scala.concurrent.impl.Promise.$anonfun$transformWith$1(Promise.scala:37)
at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:60)
at akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:55)
at akka.dispatch.BatchingExecutor$BlockableBatch.$anonfun$run$1(BatchingExecutor.scala:91)
at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:81)
at akka.dispatch.BatchingExecutor$BlockableBatch.run(BatchingExecutor.scala:91)
at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:40)
at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(ForkJoinExecutorConfigurator.scala:44)
at akka.dispatch.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
at akka.dispatch.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
at akka.dispatch.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
at akka.dispatch.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)`
Curl output -Verbose
Relevant Application.conf
/etc/thehive# cat application.conf
search {
index = the_hive
cluster = hive
host = ["127.0.0.1:9300"]
}
auth {
provider = [local, ad]
ad {
domainFQDN = "MYDOMAIN.local"
serverNames = [ADSERVER1, ADSERVER2]
domainName = "MYDOMAIN"
useSSL = true
}
}
{
warning = 5m
inactivity = 1h
}
play.http.parser.maxMemoryBuffer= 1M
play.http.parser.maxDiskBuffer = 1G
play.modules.enabled += connectors.cortex.CortexConnector
cortex {
"CORTEX-SERVER-ID" {
url = "http://127.0.0.1:9001"
key = "somekey"
}
}
play.http.secret.key="somekey"
Works with Basic Auth
curl -v --request PATCH -u user:pw -H "Content-type: application/json" -d '{"resolutionStatus": "Other","summary": "auto - closed by user request(Hive API)"}' http://server9000/api/case/AWmmIanujG3xWCFBpAsG
The text was updated successfully, but these errors were encountered: