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

ldap: fix GetUserByClaim for binary encoded UUIDs #4249

Merged
merged 1 commit into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions changelog/unreleased/fix-ldap-getuserbyclaim-userid.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Bugfix: GetUserByClaim not working with MSAD for claim "userid"

We fixed GetUserByClaim to correctly deal with binary encoded userid
as e.g. used for Active Directory.

https://github.com/cs3org/reva/pull/4249
https://github.com/owncloud/ocis/issues/7469
4 changes: 2 additions & 2 deletions pkg/utils/ldap/identity.go
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ func (i *Identity) getUserAttributeFilter(attribute, value string) (string, erro
default:
return "", errors.New("ldap: invalid field " + attribute)
}
if attribute == "userid" && i.User.Schema.IDIsOctetString {
if attribute == i.User.Schema.ID && i.User.Schema.IDIsOctetString {
id, err := uuid.Parse(value)
if err != nil {
err := errors.Wrap(err, fmt.Sprintf("error parsing OpaqueID '%s' as UUID", value))
Expand Down Expand Up @@ -687,7 +687,7 @@ func (i *Identity) getGroupAttributeFilter(attribute, value string) (string, err
default:
return "", errors.New("ldap: invalid field " + attribute)
}
if attribute == "group_id" && i.Group.Schema.IDIsOctetString {
if attribute == i.Group.Schema.ID && i.Group.Schema.IDIsOctetString {
id, err := uuid.Parse(value)
if err != nil {
err := errors.Wrap(err, fmt.Sprintf("error parsing OpaqueID '%s' as UUID", value))
Expand Down
Loading