Skip to content

Enable using the userpass client to log in to an ldap backend#161

Open
babbageclunk wants to merge 1 commit into
jmgilman:masterfrom
babbageclunk:userpass-ldap
Open

Enable using the userpass client to log in to an ldap backend#161
babbageclunk wants to merge 1 commit into
jmgilman:masterfrom
babbageclunk:userpass-ldap

Conversation

@babbageclunk
Copy link
Copy Markdown

The ldap backend login response has "data": {} because of this line:
https://github.com/hashicorp/vault/blob/main/builtin/credential/ldap/backend.go#L121

(This is different from the other backends I looked at, they all use a pattern more like this, so logical.Response.Data would always be nil.)

When deserializing the login response the type of EndpointResult.data is currently Option<()>, but testing with serde shows that "data": null is the only value that can be read into that type. Changing the userpass login response type to HashMap<(), ()> allows data to be null or {}, so we can use it to login against an ldap backend.

Fixes #104

The ldap backend response comes back with `"data": {}` because of this
line:
https://github.com/hashicorp/vault/blob/main/builtin/credential/ldap/backend.go#L121

For the login request `EndpointResult.data` is currently `Option<()>`,
but testing with serde shows that will only accept `"data":
null`. Changing the login response to `HashMap<(), ()>` means
`EndpointResult.data` can be `null` or `{}`.
@stormshield-gt
Copy link
Copy Markdown
Collaborator

Thanks for submitting this PR. Do you think it will be possible to provide some tests proving that's the LDAP login actually works ?

@babbageclunk
Copy link
Copy Markdown
Author

Ok, I'll look at adding some now.

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

Successfully merging this pull request may close these issues.

Is it possible to use userpass login feature to login against ldap engine

2 participants