我已经实现了一个Identity Server4,它看起来很棒 . 现在,我需要将原生移动应用程序(xamarin)连接到它 . 大多数博客和讨论都建议使用“授权代码”或“混合”流程,而github中的xamarin示例使用“隐式”流程 .
我已经阅读了有关授权流程的文档,并且没有谈论用户名或密码 . https://identityserver4.readthedocs.io/en/release/endpoints/authorize.html
我需要的是允许用户将他/她的用户名和密码提供给认证服务器,服务器最终应该返回访问代码 .
- 这将是最合适的身份验证流程 .
1 回答
有两种“心态” -
a)登录UI在应用程序中是本机的
b)登录UI在浏览器中从OpenID Connect呈现
一般b)建议 - 检查规格:
https://tools.ietf.org/wg/oauth/draft-ietf-oauth-native-apps/
去年我也谈过这个问题:
https://vimeo.com/171942749
如果你绝对不想要基于重定向/服务器的方法,那么研究“资源所有者密码授权” - 例如这里:
https://identityserver4.readthedocs.io/en/release/quickstarts/2_resource_owner_passwords.html
但是,我不推荐它 .