mirror of
https://gitee.com/dcren/openiddict-documentation.git
synced 2025-09-20 18:47:54 +08:00
Update the documentation pages
This commit is contained in:
@@ -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
|
||||
}),
|
||||
|
||||
|
@@ -5661,7 +5661,7 @@
|
||||
"output": {
|
||||
".html": {
|
||||
"relative_path": "configuration/mongodb-integration.html",
|
||||
"hash": "OBbgaaZ+b0E3MY4vEl7/kw=="
|
||||
"hash": "za1L8HGicVtf0iDEj8PMvw=="
|
||||
}
|
||||
},
|
||||
"is_incremental": false,
|
||||
|
Reference in New Issue
Block a user