Skip to content

Conversation

@saurabhsathe-ms
Copy link
Contributor

@saurabhsathe-ms saurabhsathe-ms commented Apr 15, 2025

Issue #3244 add optional login and domain hints to SingIn method of Id web
Feature Request - Add optional hints to the sign in method

Description
This PR adds optional hints to the sign-in method for better user experience. User requested feature so that they can pass domain and login hint as email. These parameters are passed as an option and SignIn method works normally if these options removed.

Fixes #3244

@saurabhsathe-ms saurabhsathe-ms requested a review from a team as a code owner April 15, 2025 03:56
@saurabhsathe-ms saurabhsathe-ms changed the title Ssathe 3244 add optional hints Ssathe Issue #3244 add optional login and domain hints to SingIn method of Id web Apr 15, 2025
@saurabhsathe-ms saurabhsathe-ms changed the title Ssathe Issue #3244 add optional login and domain hints to SingIn method of Id web Add optional login and domain hints to SingIn method of Id web Apr 15, 2025
@saurabhsathe-ms saurabhsathe-ms changed the title Add optional login and domain hints to SingIn method of Id web Add optional login and domain hints to SingIn method Apr 15, 2025
@saurabhsathe-ms saurabhsathe-ms changed the title Add optional login and domain hints to SingIn method Add optional login and domain hints to SignIn method Apr 15, 2025
…ers/AccountController.cs

Co-authored-by: Westin Musser <[email protected]>
@saurabhsathe-ms saurabhsathe-ms requested a review from Copilot April 17, 2025 21:01
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds optional login and domain hint parameters to the SignIn method to improve the user experience by allowing hints for email and domain during sign-in.

  • Updated AccountController.SignIn to accept optional loginHint and domainHint parameters.
  • Updated Public API definitions to reflect the new signature while removing the old one.
  • Added and updated tests to ensure the new behavior works both with and without the hints.

Reviewed Changes

Copilot reviewed 4 out of 6 changed files in this pull request and generated no comments.

File Description
tests/Microsoft.Identity.Web.UI.Test/Areas/MicrosoftIdentity/Controllers/AccountControllerTests.cs Added tests covering scenarios with and without login and domain hints.
src/Microsoft.Identity.Web.UI/PublicAPI.Unshipped.txt Added new API signature including loginHint and domainHint parameters.
src/Microsoft.Identity.Web.UI/PublicAPI.Shipped.txt Removed the previous overload of SignIn without the new parameters.
src/Microsoft.Identity.Web.UI/Areas/MicrosoftIdentity/Controllers/AccountController.cs Updated the SignIn method to process optional loginHint and domainHint parameters.
Files not reviewed (2)
  • Microsoft.Identity.Web.sln: Language not supported
  • tests/Microsoft.Identity.Web.UI.Test/Microsoft.Identity.Web.UI.Test.csproj: Language not supported

@saurabhsathe-ms
Copy link
Contributor Author

@jennyf19 I have performed manual E2ETesting as well. Please find the screenshot attached. The sample is WebAppCallsMicrosoftGraph
image

@jmprieur
Copy link
Collaborator

@jennyf19 I have performed manual E2ETesting as well.

What code did you use to set the login hint?

@saurabhsathe-ms
Copy link
Contributor Author

saurabhsathe-ms commented Apr 21, 2025

@jmprieur I did not use any tool. Postman is what I usually used to use. But Postman is blocked. Hence just using simple get query. Here is something that I used: https://localhost:5001/MicrosoftIdentity/Account/SignIn?redirectUri=/&[email protected]&domainHint=msidlab4.onmicrosoft.com

@saurabhsathe-ms
Copy link
Contributor Author

@jmprieur I have added the sample code at the following link: https://github.com/AzureAD/microsoft-identity-web/wiki/Customization#customization-to-sign-in-experience . Can you please check and approve the PR if everything looks good?

@jmprieur
Copy link
Collaborator

@jmprieur I have added the sample code at the following link: https://github.com/AzureAD/microsoft-identity-web/wiki/Customization#customization-to-sign-in-experience . Can you please check and approve the PR if everything looks good?

Thanks, however, what would be the controller view? do you have the full sample

Copy link
Collaborator

@jmprieur jmprieur left a comment

Choose a reason for hiding this comment

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

LGTM
Thanks @saurabhsathe-ms

@saurabhsathe-ms
Copy link
Contributor Author

@jmprieur I have added the sample code at the following link: https://github.com/AzureAD/microsoft-identity-web/wiki/Customization#customization-to-sign-in-experience . Can you please check and approve the PR if everything looks good?

Thanks, however, what would be the controller view? do you have the full sample

I have provided a sample view @jmprieur

@saurabhsathe-ms saurabhsathe-ms merged commit 36fb5f5 into master Apr 28, 2025
8 checks passed
@saurabhsathe-ms saurabhsathe-ms deleted the ssathe-3244-add-optional-hints branch April 28, 2025 16:05
@AndreasTC
Copy link

Hi all, am I correct that this feature is not yet released?

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.

[Feature Request] Add optional login_hint and domain_hint to AccountController SignIn endpoint

5 participants