jhipster oauth:我如何通过CURL获取令牌 [英] jhipster oauth : How can i get the token via CURL

查看:578
本文介绍了jhipster oauth:我如何通过CURL获取令牌的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用jhipster使用oauth2身份验证创建一个新项目。项目示例工作正常,我可以使用angularjs界面登录。但是当我尝试在命令行中使用CURL检索access_token时,我得到如下响应:

I am trying to use the jhipster to create a new project with the oauth2 authentication. The project example works fine, I can login with the angularjs interface. However when I try to retrieve an access_token using CURL in the command line, I get response as :


error:Unauthorized message:Bad credentials

"error":"Unauthorized","message":"Bad credentials"

有人可以帮助我如何使用curl获取access_token?

Can someone help me on how to use curl to get the access_token?

推荐答案

在这里!

curl http://127.0.0.1:8080/oauth/token --request POST --insecure --data 
"username=[xxx]&password=[yyy]&grant_type=password&scope=read%20write&    
client_secret=[your app secret]&client_id=[your app id] " -H     
"Authorization:Basic [base64 of your appid:appsecrt]"

这篇关于jhipster oauth:我如何通过CURL获取令牌的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆