每个 Stormpath documentation ,对于密码 grant_type,只需发出如下的 post 请求:
POST /oauth/token
Host: myapi.com
Accept: application/json
Content-Type: application/x-www-form-urlencoded
grant_type=password
&<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="fc898f998e929d9199c1898f998ebc99849d918c9099d29f9391" rel="noreferrer noopener nofollow">[email protected]</a>
&password=theirPassword
但是,这不起作用并返回“unsupported_grant_type”。在我的配置中,启用了密码授予。我错过了什么?
最佳答案
弄清楚了,请求正文必须在一行上
grant_type=password&<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="b8cdcbddcad6d9d5dd85cdcbddcaf8ddc0d9d5c8d4dd96dbd7d5" rel="noreferrer noopener nofollow">[email protected]</a>&password=theirPassword
关于c# - Stormpath OAuth 2.0 不支持的授权类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41351081/