[Blazor] Add instructions to configure the authority when it is missing

* For individual auth cases, when creating the template from Visual Studio there is no way to provide parameters.
* This change adds a message in the index.html to indicate the steps that need to be followed.
This commit is contained in:
Javier Calvarro Nelson 2020-02-26 07:39:28 -08:00 committed by GitHub
parent f3633f3c38
commit a52e708e55
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 1 deletions

View File

@ -267,6 +267,10 @@
"replaces": "https://login.microsoftonline.com/",
"description": "The authority of the OIDC provider (use with standalone Individual auth)."
},
"MissingAuthority": {
"type": "computed",
"value": "(IndividualAuth && !Hosted && Authority == \"https://login.microsoftonline.com/\" && ClientId == \"33333333-3333-3333-33333333333333333\")"
},
"AAdB2CInstance": {
"type": "parameter",
"datatype": "string",

View File

@ -2,6 +2,12 @@
<h1>Hello, world!</h1>
@*#if (MissingAuthority)
<div class="alert alert-warning" role="alert">
Before authentication will function correctly, you must configure your provider details in <code>Program.cs</code>
</div>
#endif*@
Welcome to your new app.
<SurveyPrompt Title="How is Blazor working for you?" />

View File

@ -25,6 +25,10 @@ namespace ComponentsWebAssembly_CSharp
#else
builder.Services.AddOidcAuthentication(options =>
{
#if(MissingAuthority)
// Configure your authentication provider options here.
// For more information, see https://aka.ms/blazor-standalone-auth
#endif
options.ProviderOptions.Authority = "https://login.microsoftonline.com/";
options.ProviderOptions.ClientId = "33333333-3333-3333-33333333333333333";
});

View File

@ -22,6 +22,5 @@ namespace ComponentsWebAssembly_CSharp.Server
{
webBuilder.UseStartup<Startup>();
});
}
}