mirror of
https://gitee.com/dcren/openiddict-documentation.git
synced 2025-07-15 14:04:34 +08:00
Update the provider contribution guide to match the recent changes in the client sandbox
This commit is contained in:
parent
d590f5519d
commit
d41708daf6
@ -161,20 +161,22 @@ options.UseWebProviders()
|
||||
- Update `AuthenticationController.cs` to allow triggering challenges pointing to the new provider:
|
||||
|
||||
```csharp
|
||||
var issuer = provider switch
|
||||
{
|
||||
// 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();
|
||||
}
|
||||
```
|
||||
|
||||
- Update `Index.cshtml` under `Views\Home` to include a login button for the new provider:
|
||||
|
||||
```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>
|
||||
<button class="btn btn-lg btn-success" type="submit" name="provider" value="[provider name]">
|
||||
Sign in using [provider name]
|
||||
</button>
|
||||
```
|
||||
|
||||
> [!NOTE]
|
||||
|
Loading…
Reference in New Issue
Block a user