mirror of
https://gitee.com/dcren/openiddict-documentation.git
synced 2026-03-23 17:53:26 +08:00
Update the documentation pages
This commit is contained in:
@@ -221,18 +221,20 @@ options.UseWebProviders()
|
||||
</code></pre><ul>
|
||||
<li>Update <code>AuthenticationController.cs</code> to allow triggering challenges pointing to the new provider:</li>
|
||||
</ul>
|
||||
<pre><code class="lang-csharp">var issuer = provider switch
|
||||
{
|
||||
<pre><code class="lang-csharp">// Note: OpenIddict always validates the specified provider name when handling the challenge operation,
|
||||
// but the provider can also be validated earlier to return an error page or a special HTTP error code.
|
||||
if (!string.Equals(provider, "Local", StringComparison.Ordinal) &&
|
||||
// ... other providers...
|
||||
"[provider name]" => "https://[provider issuer]/",
|
||||
|
||||
_ => null
|
||||
};
|
||||
!string.Equals(provider, [provider name], StringComparison.Ordinal))
|
||||
{
|
||||
return BadRequest();
|
||||
}
|
||||
</code></pre><ul>
|
||||
<li>Update <code>Index.cshtml</code> under <code>Views\Home</code> to include a login button for the new provider:</li>
|
||||
</ul>
|
||||
<pre><code class="lang-html"><a class="btn btn-lg btn-success" asp-controller="Authentication"
|
||||
asp-action="Login" asp-route-provider="[provider name]">Sign in using [provider name]</a>
|
||||
<pre><code class="lang-html"><button class="btn btn-lg btn-success" type="submit" name="provider" value="[provider name]">
|
||||
Sign in using [provider name]
|
||||
</button>
|
||||
</code></pre><div class="NOTE"><h5>Note</h5><p>Unless you agree to share your sandbox credentials with the OpenIddict developers, the changes
|
||||
made to the sandbox project don't need to be committed and included in your pull request.</p>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user