如何通过 desktop/mobile 个应用程序使用 Identity Server 4 登录

How to use Identity Server 4 Sign-in with desktop/mobile apps

我们有一个 .Net Core Identity Server,一个 .Net Core Api,但是我们的客户端是桌面和移动应用程序。

查看 docs 似乎我们的用户需要使用混合流程登录,但似乎此流程适用于 Web 浏览器应用程序。

什么是正确的 flow/grant_type 来验证我的桌面用户并授予他们访问 Api 的权限?

混合流是正确的。请参阅此规范:

https://datatracker.ietf.org/doc/html/draft-ietf-oauth-native-apps-09

您可以使用这个库: https://github.com/IdentityModel/IdentityModel.OidcClient2

这里有一些示例: https://github.com/IdentityModel/IdentityModel.OidcClient.Samples