Forum Discussion

CSU_Scott's avatar
CSU_Scott
Brass Contributor
Apr 23, 2025
Solved

Prefill Username for Authentication

Good morning,

We have a landing page for two different tenants with different domains.  For example, xyz.com and other.xyz.com.  I want to create logic for a landing page where the user enters their name as email address removed for privacy reasons and is routed to the authentication for the appropriate tenant.  That part is fairly trivial.

The user is then presented with a dialog asking for their username and password by the EntraID IDP.  Is there a way to prefill the username to eliminate the need to enter the password twice?

 

Best regards,

Scott

  • You should be able to pass the email value as login_hint. I.e.:

    https://login.microsoftonline.com/common/oauth2/authorize?login_hint=email address removed for privacy reasons&blabla_other_params_blabla

    Do make sure to add the remaining parameters as needed, you will need at least the client_id and redirect_uri if hitting the login page directly. Most first-party services support login_hint as well, so you can bypass all that, for example for Outlook you can use:

    http://outlook.office.com/?login_hint=email address removed for privacy reasons

3 Replies

  • You should be able to pass the email value as login_hint. I.e.:

    https://login.microsoftonline.com/common/oauth2/authorize?login_hint=email address removed for privacy reasons&blabla_other_params_blabla

    Do make sure to add the remaining parameters as needed, you will need at least the client_id and redirect_uri if hitting the login page directly. Most first-party services support login_hint as well, so you can bypass all that, for example for Outlook you can use:

    http://outlook.office.com/?login_hint=email address removed for privacy reasons

    • CSU_Scott's avatar
      CSU_Scott
      Brass Contributor

      Thank you.  I passed that along to our dev team for an integration they are performing.  

      • CSU_Scott's avatar
        CSU_Scott
        Brass Contributor

        In my basic testing, this works as advertised.  Thank you Vasil.  Whether the development team can apply it for their particular purpose, not sure yet.  Really appreciate the stellar response.

Resources