Update the documentation pages

This commit is contained in:
OpenIddict Bot
2021-06-29 17:30:39 +00:00
parent f669cd5b26
commit b6c3c864e9
2 changed files with 21 additions and 16 deletions

View File

@@ -96,11 +96,13 @@ var services = new ServiceCollection();
services.AddOpenIddict()
.AddCore(options => options.UseMongoDb());
services.AddSingleton(new MongoClient("mongodb://localhost:27017").GetDatabase("openiddict"));
services.AddSingleton(new MongoClient(
"mongodb://localhost:27017").GetDatabase("openiddict"));
var provider = services.BuildServiceProvider();
var context = provider.GetRequiredService<IOpenIddictMongoDbContext>();
var options = provider.GetRequiredService<IOptionsMonitor<OpenIddictMongoDbOptions>>().CurrentValue;
var options = provider.GetRequiredService<
IOptionsMonitor<OpenIddictMongoDbOptions>>().CurrentValue;
var database = await context.GetDatabaseAsync(CancellationToken.None);
var applications = database.GetCollection<OpenIddictMongoDbApplication>(
@@ -136,7 +138,8 @@ await applications.Indexes.CreateManyAsync(new[]
var authorizations = database.GetCollection<OpenIddictMongoDbAuthorization>(
options.AuthorizationsCollectionName);
await authorizations.Indexes.CreateOneAsync(new CreateIndexModel<OpenIddictMongoDbAuthorization>(
await authorizations.Indexes.CreateOneAsync(
new CreateIndexModel<OpenIddictMongoDbAuthorization>(
Builders<OpenIddictMongoDbAuthorization>.IndexKeys
.Ascending(authorization => authorization.ApplicationId)
.Ascending(authorization => authorization.Scopes)
@@ -164,13 +167,15 @@ var tokens = database.GetCollection<OpenIddictMongoDbToken>(
await tokens.Indexes.CreateManyAsync(new[]
{
new CreateIndexModel<OpenIddictMongoDbToken>(
Builders<OpenIddictMongoDbToken>.IndexKeys.Ascending(token => token.ReferenceId),
Builders<OpenIddictMongoDbToken>.IndexKeys.Ascending(
token => token.ReferenceId),
new CreateIndexOptions<OpenIddictMongoDbToken>
{
// Note: partial filter expressions are not supported on Azure Cosmos DB.
// As a workaround, the expression and the unique constraint can be removed.
PartialFilterExpression =
Builders<OpenIddictMongoDbToken>.Filter.Exists(token => token.ReferenceId),
Builders<OpenIddictMongoDbToken>.Filter.Exists(
token => token.ReferenceId),
Unique = true
}),

View File

@@ -5661,7 +5661,7 @@
"output": {
".html": {
"relative_path": "configuration/mongodb-integration.html",
"hash": "OBbgaaZ+b0E3MY4vEl7/kw=="
"hash": "za1L8HGicVtf0iDEj8PMvw=="
}
},
"is_incremental": false,