Stormpath OAuth 2.0 不支持的授权类型

Stormpath OAuth 2.0 unsupported grant type

根据 Stormpath documentation,对于密码 grant_type,所有需要做的就是发出如下 post 请求:

POST /oauth/token
Host: myapi.com
Accept: application/json
Content-Type: application/x-www-form-urlencoded

grant_type=password
&username=user@example.com
&password=theirPassword

然而,这并不奏效 returns "unsupported_grant_type"。在我的配置中,启用了密码授予。我错过了什么?

明白了,请求正文必须在一行上

grant_type=password&username=user@example.com&password=theirPassword