feature(ldap): Adds objectSid and objectUUID formatting when using Active Directory - #4978
feature(ldap): Adds objectSid and objectUUID formatting when using Active Directory#4978SeanHood wants to merge 1 commit into
Conversation
…tive Directory #### Overview Adds support for formatting `objectSid` and `objectGUID` for use with the ldap connector and Active Directory. #### What this PR does / why we need it Closes: dexidp#3128 Active Directory stores these two attributes as byte arrays. This change converts them to strings, allowing them to be used for any `*Attr` but intended for `idAttr`. #### Special notes for your reviewer
cb46c96 to
5d31a44
Compare
|
How Dex handles non-UTF-8 data from LDAP attributes certainly leaves room for improvement, if not to say is totally broken (cf. #4017). So I sympathize with this PR (and we apply something similar as a downstream patch). But as you say, the OIDC subject is supposed to not change over time but this is what's going to happen for existing Dex users who chose objectSid as the idAttr. One might argue that their usage was broken to begin with but still, this is a major breaking change and should be communicated as such in release notes. If the log excerpts in your message really mean that using non-UTF8 attributes is no longer possible, then the breaking change already happened (but wasn't part of a release yet, I think), |
|
With regard to the actual code: are there cases where Dex would benefit from being aware of the structure and preferred text representation of NT SIDs and other binary attributes? At least for the Might as well simplify the code and treat all binary strings the same, encoding them in some Base32 variant (or a plain hex string), always. Avoid any encoding where distinct inputs may yield outputs that differ in case only, as the etcd backend will Of course, if the project decides to do a breaking change, this should rather be fixed directly within the etcd backend. |
Overview
Adds support for formatting
objectSidandobjectGUIDfor use with the ldap connector and Active Directory.What this PR does / why we need it
Active Directory stores these two attributes as byte arrays. This change converts them to strings, allowing them to be used for any
*Attrbut intended foridAttr.I believe that the Subject Claim within a JWT is intended to be a static non-changing value. In the context of AD
objectGUIDnever changes andobjectSidonly changes in certain circumstances. Whereas aDNcould change for a user either via a name change or if the object is moved to a new OU.Prior to this change using either attribute would result in an error like so:
Closes: #3128
Implementation of
formatSidAttris inspired by: https://github.com/dotnet/runtime/blob/1f0e9eadd29b9c15dae9313234abf486f1c4ef96/src/libraries/System.Security.Principal.Windows/src/System/Security/Principal/SID.cs#L395Special notes for your reviewer
Test config: