jhipster的OAuth:我怎样才能通过卷曲令牌 [英] jhipster oauth : How can i get the token via CURL

查看:159
本文介绍了jhipster的OAuth:我怎样才能通过卷曲令牌的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图用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"

有人可以帮助我了解如何使用curl拿到的access_token?

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

推荐答案

在这里你去!

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应用程序的秘密]放大器; CLIENT_ID = [您的应用程序ID]-H授权:你的appid基本[BASE64:appsecrt]

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:我怎样才能通过卷曲令牌的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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