Skip to content
This repository has been archived by the owner on Dec 7, 2020. It is now read-only.

Support for REMOTE_USER Header #669

Open
Ryonez opened this issue Jul 21, 2020 · 13 comments
Open

Support for REMOTE_USER Header #669

Ryonez opened this issue Jul 21, 2020 · 13 comments

Comments

@Ryonez
Copy link

Ryonez commented Jul 21, 2020

Title

Support for REMOTE_USER Header

Summary

Allow Gatekeeper to pass a REMOTE_USER header to the backend service

Why?

Allows gatekeeper to log users into sites which pass authentication onto the proxy/web server.

How

The header must be named REMOTE_USER, username is a good default value, but being able to set other things like email would be appreciated.

Acceptance criteria

That it works.

Additional Information

I'm attempting to get this going with Fiyefly-iii. There was an issue here where the author added support for the REMOTE_USER header.

@jangaraj
Copy link
Contributor

Could you try #532

E.g.:

add-claims:
- email|REMOTE_USER

@Ryonez
Copy link
Author

Ryonez commented Jul 21, 2020

The site is claiming the header is empty:
claim in gatekeeper's YAML
image

Site Response:
image

@jangaraj
Copy link
Contributor

That was only example. Make sure you have email claim in the access token when you want to use it
Also email|REMOTE_USER != email | REMOTE_USER. Code doesn't work with space, so don't use them, pls.

@Ryonez
Copy link
Author

Ryonez commented Jul 21, 2020

Alright, thank you for pointing out the spaces.

Two questions, first, I don't know how to make sure it is in the access token. I thought add-claims was meant to add it and I can't see the tokens or unencrypted tokens, so I really have no idea what's happening in them.
Second, is it possible to use username in place of email? emails in my system are somewhat flexible, usernames are not.

@jangaraj
Copy link
Contributor

jangaraj commented Jul 21, 2020

Go to helper /oauth/token and you will see what is available. And of course, you flexibility to map any claim from the token to any header:

add-claims:
- username|REMOTE_USER
- roles|GROUPS
- groups|ROLES
- preferred_username|nickname
....

@Ryonez
Copy link
Author

Ryonez commented Jul 21, 2020

What is helper? I'm not sure what you're asking me to look at.

@jangaraj
Copy link
Contributor

@Ryonez
Copy link
Author

Ryonez commented Jul 21, 2020

/protocol/oauth/token

Most of my endpoints seem to be openid-connect, however I'm not getting info from them either.

Sorry, I used it on the keycloak url, not through gatekeeper. One moment.

@Ryonez
Copy link
Author

Ryonez commented Jul 21, 2020

Alright, the token does have the values.

image

However the site is saying the header is empty still.

@Ryonez
Copy link
Author

Ryonez commented Jul 22, 2020

Is there a way to see what headers it's passing through to the backend service? Knowing what's there would not would at least give direction if it's an issue with gatekeeper or firefly.

@JC5
Copy link

JC5 commented Jul 22, 2020

I'm putting some pointers in the other issue. This is a relatively new feature for Firefly III as well, so I'm equally curious.

@Ryonez
Copy link
Author

Ryonez commented Jul 22, 2020

Following JC5's information, I've been able to determine that gatekeeper is not adding the custom REMOTE_USER header, only the default X_AUTH headers.

@Ryonez
Copy link
Author

Ryonez commented Jul 22, 2020

Edit: Posted this in the wrong issue thread.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants