-
Notifications
You must be signed in to change notification settings - Fork 148
Conversation
All auth methods return the same token payload, more or less. Let them all share how the access token is set.
Addresses #15 |
Nice - will take a closer look at this when we get the chance in the next few days. Thanks for contributing! |
Sweet! Thanks. I showed this to my team today and we voted to adopt. I can be a regular contributor if you're open to it. |
Most definitely @joraff!! This LGTM. Currently at re:Invent, I'll do some deeper checks later tonight and get it merged in. |
@@ -70,12 +70,11 @@ export default class Login extends React.Component { | |||
"Creds": { | |||
"Type": this.state.loginMethodType, | |||
"Username": this.state.username, | |||
"password": this.state.password | |||
"Password": this.state.password | |||
} | |||
}) | |||
.then((resp) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to add an LDAP login methodtype to the login API here: https://github.com/djenriquez/vault-ui/blob/master/src/login.js#L29 because LDAP uses a different endpoint for authentication. Without this change the API will return a 400: "Invalid auth method".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See next commit :)
@@ -153,6 +125,24 @@ export default class Login extends React.Component { | |||
} | |||
} | |||
|
|||
setAccessToken(resp) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice 👍
}; | ||
break; | ||
case 'ldap': | ||
endpoint = `/v1/auth/ldap/login/${username}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah there it is 😜
Thanks @joraff! |
Adds LDAP as a login method option. Finishes username & password authentication, which LDAP shares some functions with. Minor refactoring.