Version 6.x has been out of support since May 14, 2024, and this corresponding section of the documentation is no longer maintained. We strongly recommend you upgrade to the latest supported version of 7.x and read the latest version of this documentation.
The /bff/login endpoint begins the authentication process. To use it, typically javascript code will navigate away from the frontend application to the login endpoint:
window.location = "/bff/login";
In Blazor, instead use the NavigationManager to navigate to the login endpoint:
Navigation.NavigateTo($"bff/login", forceLoad: true);
The login endpoint triggers an authentication challenge using the default challenge scheme, which will typically use the OpenID Connect handler.
After authentication is complete, the login endpoint will redirect back to your front end application. By default, this redirect goes to the root of the application. You can use a different URL instead by including a local URL as the returnUrl query parameter.
window.location = "/bff/login?returnUrl=/logged-in";