Use "allow_empty_authorization_id" flag to allow AUTHZ_ID=None#47
Open
sravan0x00 wants to merge 1 commit intothobbs:masterfrom
Open
Use "allow_empty_authorization_id" flag to allow AUTHZ_ID=None#47sravan0x00 wants to merge 1 commit intothobbs:masterfrom
sravan0x00 wants to merge 1 commit intothobbs:masterfrom
Conversation
This commit introduces a flag allow_empty_authorization_id in SASLClient constructor. This flag can be used to set AUTHZ_ID='' dring SASL AUTH. Setting this flag will effectively bypass comparision or lookup of AUTHN_ID to AUTHZ_ID on server side. This is allowed per RFC and is also the default behaviour most SASL clients in other langages like C, Go, Java. This behaviour is as per [SASL RFC section-3.4.1](https://datatracker.ietf.org/doc/html/rfc4422#section-3.4.1), that states ``` If the authorization identity string is absent, the client is requesting to act as the identity the server associates with the client's credentials. An empty string is equivalent to an absent authorization identity. ``` This also fixes issue we see with Windows user names in the domain prefixed form `CONTOSO\\foobar` failing on SASL authorization check.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit introduces a flag
allow_empty_authorization_idin SASLClient constructor. This flag can be used to set AUTHZ_ID='' during SASL authentication.Setting this flag will effectively bypass comparison of AUTHN_ID to AUTHZ_ID on server side in cyrus-sasl library, which is currently causing below error in case of a mismatch.
This is as per SASL RFC section-3.4.1, that states
Allowing empty AUTHZ_ID is the default behavior of most SASL clients in languages like C, Go, Java. By way of doing it via a constructor flag, we make sure we don't break any existing users code.
This also fixes the issue we see with Windows usernames in domain prefixed form
CONTOSO\\foobarfailing on SASL authorization check (PR#46) and making this library unusable on Windows (and also Kerberos use cases where user principal is likefoobar-pkinit@CONTOSO.com).