[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:
parent
f3633f3c38
commit
a52e708e55
|
|
@ -267,6 +267,10 @@
|
||||||
"replaces": "https://login.microsoftonline.com/",
|
"replaces": "https://login.microsoftonline.com/",
|
||||||
"description": "The authority of the OIDC provider (use with standalone Individual auth)."
|
"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": {
|
"AAdB2CInstance": {
|
||||||
"type": "parameter",
|
"type": "parameter",
|
||||||
"datatype": "string",
|
"datatype": "string",
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,12 @@
|
||||||
|
|
||||||
<h1>Hello, world!</h1>
|
<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.
|
Welcome to your new app.
|
||||||
|
|
||||||
<SurveyPrompt Title="How is Blazor working for you?" />
|
<SurveyPrompt Title="How is Blazor working for you?" />
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,10 @@ namespace ComponentsWebAssembly_CSharp
|
||||||
#else
|
#else
|
||||||
builder.Services.AddOidcAuthentication(options =>
|
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.Authority = "https://login.microsoftonline.com/";
|
||||||
options.ProviderOptions.ClientId = "33333333-3333-3333-33333333333333333";
|
options.ProviderOptions.ClientId = "33333333-3333-3333-33333333333333333";
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,5 @@ namespace ComponentsWebAssembly_CSharp.Server
|
||||||
{
|
{
|
||||||
webBuilder.UseStartup<Startup>();
|
webBuilder.UseStartup<Startup>();
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue