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

Add support for passing A1 into the digest #15

Merged
merged 1 commit into from
Jan 19, 2025

Conversation

InnovativeUS
Copy link
Contributor

@InnovativeUS InnovativeUS commented Jan 17, 2025

Introduce the ability to pass A1 as a value to Digest, allowing the use of a third party authentication service.

See https://datatracker.ietf.org/doc/html/rfc7616#section-3.4.2

"Because the server needs only use the hash of the user credentials in order to create the A1 value, this construction could be used in conjunction with a third-party authentication service so that the web server would not need the actual password value."

@icholy
Copy link
Owner

icholy commented Jan 19, 2025

Code looks good, but can you explain the use-case a bit more (concrete examples are better). If you're passing A1 instead of the Username & Password, how are you using the returned Credentials? What does the calling code look like? Won't the empty username param cause issues in the formatted credentials?

digest/credentials.go

Lines 75 to 79 in f2e2eb0

param.Param{
Key: "username",
Value: c.Username,
Quote: true,
},

@InnovativeUS
Copy link
Contributor Author

InnovativeUS commented Jan 19, 2025 via email

@icholy icholy merged commit 7a207b9 into icholy:master Jan 19, 2025
1 check passed
@icholy
Copy link
Owner

icholy commented Jan 19, 2025

Tagged as v1.1.0

@icholy
Copy link
Owner

icholy commented Jan 19, 2025

Thank you for your contribution.

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.

2 participants