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

Implement support for authentication via Auth Proxy #570

Merged
merged 1 commit into from
Feb 25, 2020
Merged

Implement support for authentication via Auth Proxy #570

merged 1 commit into from
Feb 25, 2020

Conversation

pborzenkov
Copy link
Contributor

Auth Proxy allows to authenticate a user using an HTTP header provided
by an external authentication service. This provides a way to
authenticate users in miniflux using authentication schemes not
supported by miniflux itself (LDAP, non-Google OAuth2 providers, etc.)
and to implement SSO for multiple applications behind single
authentication service.

Auth Proxy header is checked for the '/' endpoint only, as the rest are
protected by the miniflux user/app sessions.

Closes #534

@pborzenkov pborzenkov changed the title Implement support for authenticaion via Auth Proxy Implement support for authentication via Auth Proxy Jan 29, 2020
Auth Proxy allows to authenticate a user using an HTTP header provided
by an external authentication service. This provides a way to
authenticate users in miniflux using authentication schemes not
supported by miniflux itself (LDAP, non-Google OAuth2 providers, etc.)
and to implement SSO for multiple applications behind single
authentication service.

Auth Proxy header is checked for the '/' endpoint only, as the rest are
protected by the miniflux user/app sessions.

Closes #534

Signed-off-by: Pavel Borzenkov <pavel.borzenkov@gmail.com>
@fguillot
Copy link
Member

fguillot commented Feb 6, 2020

Sorry for the delay, I will try to find some time to review your PR over the weekend.

Copy link
Member

@fguillot fguillot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pborzenkov What about using Auth Proxy for the API endpoints and URLs other than /?

With the actual implementation, if a non-authenticated user goes directly to a specific URL (for example /unread/entry/1234 ), it will be redirected to the login page instead of using Auth Proxy.

@pborzenkov
Copy link
Contributor Author

Sorry for the delay. I was on vacation with no access to the Internet.

With the actual implementation, if a non-authenticated user goes directly to a specific URL (for example /unread/entry/1234 ), it will be redirected to the login page instead of using Auth Proxy.

Where it will be authenticated using Auth Proxy. This keeps the same behaviour as with other login methods (user/pass and OAuth). If this is something you are not happy with and would rather have Auth Proxy checks on all endpoints, I'll update the PR. I just wanted to keep consistent experience between different login methods.

@fguillot
Copy link
Member

That seems to work fine for the web ui. What about the REST API?

The Grafana example cited in issue #534 seems to allow the Auth-Proxy for API access as well. Might be a nice to have.

I'm thinking about implementing an API tokens mechanism in the future instead of using the user password...

@pborzenkov
Copy link
Contributor Author

That seems to work fine for the web ui. What about the REST API?

I was thinking about adding support to the REST API initially. But then what's the workflow is gonna be? When accessing miniflux via Web UI, a user might be redirected by a reverse proxy to an entity that actually authenticates it and this entity might be interactive (e.g. login via OpenID provider). Not sure how this can be implemented for API access.

And the API client can't set Auth proxy header by itself, as the header must be stripped by the reverse proxy (for security reasons).

So I can't really see how the Auth proxy workflow can be supported in the API. And I'm not really sure it's actually needed. If you're planning to add tokens, then Auth proxy for UI + tokens for API will work smoothly together: a user logs in via UI (authenticated via Auth proxy) and creates a token for API access.

@fguillot
Copy link
Member

I think it's good enough for now. Let's merge :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Auth proxy (authenticate user by incoming HTTP header)
2 participants