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

Fix Microsoft connector emailToLowercase for refresh token #3699

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

hur
Copy link
Contributor

@hur hur commented Aug 16, 2024

Fixes #3283

Overview

Respect the emailToLowercase config in the Refresh() function

What this PR does / why we need it

Updates the Refresh function to also consider the config option emailToLowercase.

Special notes for your reviewer

I have added unit tests. I have not tested in practice - I don't have a access to a Microsoft tenant.

Fixes dexidp#3283

Signed-off-by: Atte Niemi <4998544+hur@users.noreply.github.com>
@hur hur force-pushed the fix/microsoft-connector-email-refresh branch from 49bb349 to 66b68d8 Compare August 16, 2024 17:55
@hur hur changed the title DRAFT: Fix Microsoft connector emailToLowercase for refresh token Fix Microsoft connector emailToLowercase for refresh token Aug 16, 2024
@hur hur marked this pull request as ready for review August 16, 2024 19:18
Signed-off-by: Atte Niemi <4998544+hur@users.noreply.github.com>
@hur hur force-pushed the fix/microsoft-connector-email-refresh branch from 379d639 to 83a852a Compare August 16, 2024 19:19
expectEquals(t, identity.Email, "jane.doe@example.com")
expectEquals(t, identity.EmailVerified, true)
expectEquals(t, len(identity.Groups), 0)

Copy link
Contributor Author

@hur hur Aug 16, 2024

Choose a reason for hiding this comment

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

I didn't add a check for expectEquals(t, identity.ConnectorData, expectedConnectorData) (like in gitea_test.go, for example) as I wasn't sure if there's a good way to mock the Expiry time from a quick look around the codebase

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.

Microsoft connector - emailToLowercase only respected for initial access token
1 participant