spring security oauth2默认的错误信息返回格式是xml,如果要返回json,可以在请求头中指定‘Accept: application/json’。
指定为json示例
curl -i -L -H 'Accept: application/json' --data 'client_id=0000-0003-2736-8061&client_secret=5f63d1c5-3f08-4fa5-b066-fd985ffd0df7&grant_type=authorization_code&code=Q70Y3A&redirect_uri=https://developers.google.com/oauthplayground' 'http://api.sandbox-1.orcid.org/oauth/token'
指定为xml示例
curl -i -L -H 'Accept: application/xml' --data 'client_id=0000-0003-2736-8061&client_secret=5f63d1c5-3f08-4fa5-b066-fd985ffd0df7&grant_type=authorization_code&code=Q70Y3A&redirect_uri=https://developers.google.com/oauthplayground' 'http://api.sandbox-1.orcid.org/oauth/token'