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

[Bug] Header Variable authentication does not work #1251

Closed
crackytsi opened this issue Mar 5, 2020 · 6 comments
Closed

[Bug] Header Variable authentication does not work #1251

crackytsi opened this issue Mar 5, 2020 · 6 comments
Assignees
Labels
bug cannot reproduce TheHive4 TheHive4 related issues
Milestone

Comments

@crackytsi
Copy link

Bug

Work Environment

Question Answer
OS version (server) Debian
OS version (client) 10
TheHive version / git hash 4 RC1
Package Type DEB

Problem Description

Header Variable Authentication does not work as Expected.
My Auth-Config is:

auth {
  providers = [
    {name: session}
    {name: header, userHeader:THEHIVE_USER}
    {name: key}
    {name: local}
  ]
}

I can not see any error message or the authenticated user.
Actually my reverse proxy are the same as in TheHive , there I just had an entry like this:
header.name = THEHIVE_USER

The username is lowercased.

Steps to Reproduce

  1. Configure header variable authentication
  2. Try to authenticate using the header
@crackytsi crackytsi added TheHive4 TheHive4 related issues bug labels Mar 5, 2020
@To-om To-om self-assigned this Mar 10, 2020
@To-om
Copy link
Contributor

To-om commented Mar 10, 2020

@crackytsi I can't reproduce the problem. The user name is case sensitive.

@crackytsi
Copy link
Author

Hi @To-om
Is there any difference regarding the TheHive3.4 parameter:
header.name = THEHIVE_USER
?

I don't know, but it does not work.
Do I have any debugging possibilities?

@crackytsi
Copy link
Author

Btw:
Making the login name case sensitive is very uncommon.
Especially Email is a case-insensitive, means email is received if you send it to someone@example.com or someOne@exAMPle.coM

@To-om
Copy link
Contributor

To-om commented Mar 10, 2020

I'll lowercase user logins. This will solve case sensitivity.

Regarding authentication with header, I use this command: curl -H 'THEHIVE_USER: myuser@thehive.local' http://127.0.0.1:9000/api/user/current

Note that if you have set auth.defaultUserDomain in configuration (the default value is thehive.local) you can omit the domain in the login: curl -H 'THEHIVE_USER: myuser' http://127.0.0.1:9000/api/user/current

To-om added a commit that referenced this issue Mar 10, 2020
@crackytsi
Copy link
Author

@To-om Thanks a lot!!! Thats very nice :) :)
I double-checked it and you are right, my lowercasing did not work correctly on reverse proxy.

Thanks a lot also for your lowercasing, we can close this topic now :)

@To-om
Copy link
Contributor

To-om commented Mar 10, 2020

thank you for your feedback.

@To-om To-om closed this as completed Mar 10, 2020
@To-om To-om added this to the 4.0.0-RC2 milestone Mar 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug cannot reproduce TheHive4 TheHive4 related issues
Projects
None yet
Development

No branches or pull requests

2 participants