Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Getting Started Login Page

Mika Berglund edited this page Feb 6, 2021 · 1 revision

Creating a Login Page

Blazorade Teams needs a login page that is used together with Teams to perform interactive login in case tokens cannot be acquired silently. This can happen the first time a user logs in to the application. The login page is needed also if your application requires access tokens with scopes that the user has not yet consented to.

Don't worry, Blazorade Teams makes it super easy to create a login page.

Create the Razor Page

First you need to add the page to your application. In Blazor, pages are located in the Pages folder of your application.

When you have the page created, clear all of its contents, and add the following line on the top of the file.

@page "/login"

Note that this should be the same that you have configured as LoginUrl in your Startup class.

Then, add the rest of the code.

<LoginDialogHandler>
    <p>
        Hang on. We're logging you in. This will usually happen
        only the first time you use the application, or when the
        application needs you to consent to more permissions.
    </p>
</LoginDialogHandler>

That completes your login page.