IdentityServer3 通过用户名和密码获取用户令牌 post REQUEST

IdentityServer3 get user token by username and password post REQUEST

我找到了这个教程,用于通过用户名和密码从身份服务器进行身份验证和获取令牌:

http://leastprivilege.com/2013/11/13/embedding-a-simple-usernamepassword-authorization-server-in-web-api-v2/

https://identityserver.github.io/Documentation/docs/overview/simplestOAuth.html

https://github.com/IdentityModel/Thinktecture.IdentityModel/tree/e6cf193dbffbe1dc3a15848106807983ec503c22/samples/OAuth2/EmbeddedResourceOwnerFlow

到处都写着 url 就像:

&grant_type=password&username=aa&password=aa

我的问题是我是否也需要像示例中那样 EmbeddedAuthorizationServer 或者我可以直接调用 SSO 服务器吗?

我想 post SSO 服务器的用户名和密码以及 return 返回令牌。可能吗?

IdentityServer3 支持所谓的资源所有者密码凭证流。

https://www.rfc-editor.org/rfc/rfc6749#section-4.3

https://identityserver.github.io/Documentation/docsv2/endpoints/token.html

https://github.com/IdentityServer/IdentityServer3.Samples/tree/master/source/Clients/ConsoleResourceOwnerClient

所以答案是肯定的。

编辑:修复了死掉的 IdServer-Link,因为文档移到了 docsv2