Skip to content

chore/SRE-583 Deprecate usage of Auth-Email Header #1528

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,8 @@ struct IdentityTokenRequest: Request {

/// HTTP headers to be sent in the request.
var headers: [String: String] {
guard case let .password(email, _) = requestModel.authenticationMethod else {
return [:]
}
return ["Auth-Email": Data(email.utf8).base64EncodedString().urlEncoded()]
// Auth-Email header is deprecated and no longer needed
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this change live in any environment? I tested this in dev, QA, and prod but always get a 400 error from the /identity/connect/token endpoint when attempting to log in.

POST https://vault.usdev.bitwarden.pw/identity/connect/token 400
Response:
{
    "error": "invalid_grant",
    "error_description": "Auth-Email header invalid."
}

return [:]
}

/// The HTTP method for this request.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ class IdentityTokenRequestTests: BitwardenTestCase {
XCTAssertTrue(subjectAuthorizationCode.headers.isEmpty)
}

/// `headers` returns the headers needed for a password request.
/// `headers` returns empty headers for a password request as Auth-Email is deprecated.
func test_headers_password() {
XCTAssertEqual(subjectPassword.headers, ["Auth-Email": "dXNlckBleGFtcGxlLmNvbQ"])
XCTAssertTrue(subjectPassword.headers.isEmpty)
}

/// `method` returns the method of the request.
Expand Down
Loading