spring cloud oauth2系列篇(三)password模式获取access_token

项目的源码地址:https://github.com/daxian-zhu/online_edu

password模式和上一篇文章的代码是一致的:

https://blog.csdn.net/zhuwei_clark/article/details/96174086

访问方式稍微有点不一样

http://localhost:9004/oauth/token?grant_type=password&username=daxian&password=zwass1314&scope=xx&client_id=daxian&client_secret=hq

password模式是不需要code的,直接通过账号个密码已经client_id和client_secret就可以获取access_token。

当然前提是client支持password的模式。

发布了149 篇原创文章 · 获赞 36 · 访问量 14万+

猜你喜欢

转载自blog.csdn.net/zhuwei_clark/article/details/96178885