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

[Feature Request] Map header value to username #104

Open
KairuByte opened this issue Feb 8, 2022 · 4 comments
Open

[Feature Request] Map header value to username #104

KairuByte opened this issue Feb 8, 2022 · 4 comments

Comments

@KairuByte
Copy link

KairuByte commented Feb 8, 2022

I've been testing Header Auth with Cloudflare Zero Trust, but I've run into an odd limitation. I have no way of setting what the header passes to Home Assistant. The only value that seems to be passed is the users email address.

Would it be possible to add a list of [header_value] => [username] translations, to account for such situations?

I'm thinking something along these lines:

auth_header:
  username_header: Cf-Access-Authenticated-User-Email
  username_mapping:
    - [email protected]: user1
    - [email protected]: user2
    - [email protected]: user2
@BeryJu
Copy link
Owner

BeryJu commented Mar 1, 2022

I dont think this is something that should by done by the SSO client, I played around a bit and noticed that you can set the username to anything, so you could just set the username to the email addresses. Something I would be open to adding is a more general mutation option, like search+replace or regex replace

@cchance27
Copy link

cchance27 commented Nov 19, 2023

Ran into this as well, any chance for some form of manipulation?

Edit: for now i've put the display-name as the emailaddress cloudflare is setting in Cf-Access-Authenticated-User-Email, it's still secure because its all behind the cloudflared tunnel

@KairuByte
Copy link
Author

Manipulation would be fine with me as well. My main concern is that users can sign in with multiple services, resulting in different emails being associated with one user.

@cchance27
Copy link

True that is an issue realistically manipulation isn’t the solution you’d need some form of mapping on the HA side of valid emails to username mappings for the cloudflare case to support access from multiple login types

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