我已经为我的 ASP.Net MVC 客户端成功配置了一个 Identityserver4,并且一切正常。 现在我正在寻找开发一个 Android 应用程序客户端。 MVC 客户端和Android 客户端使用相同的Identity Server 进行身份验证和授权。 所以对于 Android 客户端,我正在寻找 "AppAuth-Android" GitHub 库。但是我找不到任何示例或帮助将库与 IdentityServer4 一起使用。我已经阅读了“AppAuth-Android”库的文档,上面写着
In general, AppAuth can work with any Authorization Server (AS) that supports native apps.
所以我的问题是 1) 如何配置我的身份服务器以使用 Android 应用程序。
2) 如何在“AppAuth-Android”的帮助下验证我的 Android 应用程序。
非常感谢任何帮助。
有人可以为“AppAuth-Android”创建一个标签吗?
最佳答案
基本上,您可以对 identityserver4 使用以下设置
new Client
{
ClientId = "client.android",
RequireClientSecret = false,
ClientName = "Android app client",
AllowedGrantTypes = GrantTypes.Code,
RequirePkce = true,
RequireConsent = false,
RedirectUris = { "net.openid.appauthdemo://oauth2redirect" },
AllowedScopes =
{
IdentityServerConstants.StandardScopes.OpenId,
IdentityServerConstants.StandardScopes.Profile,
IdentityServerConstants.StandardScopes.Email,
IdentityServerConstants.StandardScopes.Phone,
"api1"
},
AllowOfflineAccess = true
}
反正可以引用https://github.com/IdentityServer/IdentityServer4/issues/479有关此问题的更多详细信息。
关于android - 如何将 AppAuth-Android 与 IdentityServer4 一起使用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40604144/