对于刷新流程,我是否需要为我的客户端创建一个 OpenIddictApplicationDescriptor?

For refresh flow, do I need to create an OpenIddictApplicationDescriptor for my client?

我正在使用刷新流程示例,但我添加了自省中间件,因为我的资源服务器与我的授权服务器是分开的。使用 angular 应用程序,我能够连接到授权服务器。一切正常。但是我注意到在隐式流示例中添加了以下代码:

            if (await manager.FindByClientIdAsync("aurelia", cancellationToken) == null)
            {
                var descriptor = new OpenIddictApplicationDescriptor
                {
                    ClientId = "aurelia",
                    DisplayName = "Aurelia client application",
                    PostLogoutRedirectUris = { new Uri("http://localhost:9000/signout-oidc") },
                    RedirectUris = { new Uri("http://localhost:9000/signin-oidc") }
                };

                await manager.CreateAsync(descriptor, cancellationToken);
            }

我是否需要为刷新流程添加类似的内容?

如果您不将 OpenIddict 配置为要求令牌请求 client_id(通过调用 options.RequireClientIdentification()),则不必在数据库中创建应用程序即可使用刷新令牌流.