Skip to content

Default Reply Uri

henrikm edited this page Oct 10, 2020 · 5 revisions

In MSAL.NET 4.1+ The default redirect URI(Reply URI) can now be set with the public PublicClientApplicationBuilder WithDefaultRedirectUri() method. This method will set the public client applications redirect uri property to the default recommended redirect uri for public client applications.

This method's behavior is dependent upon the platform that you are using at the time. Here is a table that describes what redirect uri is set on certain platforms:

Platform Redirect URI
desktop app (.NET FW) https://login.microsoftonline.com/common/oauth2/nativeclient
UWP value of WebAuthenticationBroker.GetCurrentApplicationCallbackUri()
.NET Core http://localhost

For the UWP platform, we want to enhance the experience by enabling SSO with the browser by setting the value to the result of WebAuthenticationBroker.GetCurrentApplicationCallbackUri().

For .NET Core, we are setting the value to the local host to enable the user to use the system browser for interactive authentication since .NET Core does not have a UI for the embedded web view at the moment.

Getting started with MSAL.NET

Acquiring tokens

Web Apps / Web APIs / daemon apps

Desktop/Mobile apps

Advanced topics

FAQ

Other resources

Clone this wiki locally