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

[security] Support alternate auth providers for login #26979

Merged
merged 5 commits into from
Dec 13, 2018

Conversation

epixa
Copy link
Contributor

@epixa epixa commented Dec 11, 2018

Login is no longer coupled directly to our basic auth provider, so
alternative auth providers can now be used with our standard login flow.
The LoginAttempt request service is the mechanism for auth providers to
integrate with the login flow.

The only noticeable change here from a product perspective is that
requests authenticated via basic headers should no longer respond with
a session cookie. Beyond that, basic authentication should still be possible
for curl commands and login should otherwise appear to work as it always
has.

Login is no longer coupled directly to our basic auth provider, so
alternative auth providers can now be used with our standard login flow.
The LoginAttempt request service is the mechanism for auth providers to
integrate with the login flow.
@epixa epixa self-assigned this Dec 11, 2018
@epixa
Copy link
Contributor Author

epixa commented Dec 11, 2018

Transient CI failure due to #26228

@epixa
Copy link
Contributor Author

epixa commented Dec 11, 2018

retest

@elasticmachine

This comment has been minimized.

/**
* Utility class that knows how to decorate request with proper Basic authentication headers.
*/
export class BasicCredentials {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nothing in BasicCredentials changed, I just had to move it to the top of the file so I could use it within _authenticateViaLoginAttempt without the linter complaining.

@@ -123,7 +193,7 @@ export class BasicAuthenticationProvider {
this._options.log(['debug', 'security', 'basic'], 'Request has been authenticated via header.');

return {
authenticationResult: AuthenticationResult.succeeded(user, { authorization })
authenticationResult: AuthenticationResult.succeeded(user)
Copy link
Contributor Author

@epixa epixa Dec 11, 2018

Choose a reason for hiding this comment

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

No more cookie for basic auth headers. It's worth mentioning that this change isn't essential for the addition of LoginAttempt nor the token provider, but it seems like the right behavior, and I can't think of a reason why the old behavior should be supported.

Copy link
Member

Choose a reason for hiding this comment

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

and I can't think of a reason why the old behavior should be supported.

We didn't have this behavior before "auth providers", I'm really glad you removed that nasty thing! I can sleep well again now 🙂

@epixa epixa removed their assignment Dec 11, 2018
@epixa epixa added non-issue Indicates to automation that a pull request should not appear in the release notes Team:Security Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more! labels Dec 11, 2018
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-security

@epixa epixa requested a review from kobelb December 11, 2018 20:36
@epixa epixa added the Feature:Security/Authentication Platform Security - Authentication label Dec 11, 2018
@epixa

This comment has been minimized.

@epixa epixa added the review label Dec 11, 2018
@elasticmachine

This comment has been minimized.

@elasticmachine

This comment has been minimized.

Copy link
Contributor

@kobelb kobelb left a comment

Choose a reason for hiding this comment

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

LGTM - pending green CI

@elasticmachine

This comment has been minimized.

@epixa
Copy link
Contributor Author

epixa commented Dec 12, 2018

retest

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@epixa epixa merged commit ded7063 into elastic:master Dec 13, 2018
@epixa epixa deleted the login-attempt-service branch December 13, 2018 00:22
epixa added a commit to epixa/kibana that referenced this pull request Dec 13, 2018
Login is no longer coupled directly to our basic auth provider, so
alternative auth providers can now be used with our standard login flow.
The LoginAttempt request service is the mechanism for auth providers to
integrate with the login flow.
epixa added a commit that referenced this pull request Dec 13, 2018
Login is no longer coupled directly to our basic auth provider, so
alternative auth providers can now be used with our standard login flow.
The LoginAttempt request service is the mechanism for auth providers to
integrate with the login flow.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Security/Authentication Platform Security - Authentication non-issue Indicates to automation that a pull request should not appear in the release notes review Team:Security Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants