Update the PKCE documentation to indicate how to enable code_challenge_method=plain support

This commit is contained in:
Kévin Chalet 2021-05-25 16:52:37 +02:00
parent bc5b601d23
commit 24052130ee

View File

@ -52,4 +52,17 @@ await manager.CreateAsync(new OpenIddictApplicationDescriptor
Requirements.Features.ProofKeyForCodeExchange
}
});
```
## Enabling `code_challenge_method=plain` support
By default, OpenIddict only supports `code_challenge_method=S256`, which is the safest code challenge method and the only one required by the PKCE specification.
While not recommended, support for the `code_challenge_method=plain` method can be manually enabled by adding it to `OpenIddictServerOptions.CodeChallengeMethods`:
```csharp
services.AddOpenIddict()
.AddServer(options =>
{
options.Configure(options => options.CodeChallengeMethods.Add(CodeChallengeMethods.Plain));
});
```