Need help in oauth2 golang

xuanbao · 2017-09-06 21:00:08 · 639 次点击    
这是一个分享于 2017-09-06 21:00:08 的资源,其中的信息可能已经有所发展或是发生改变。

i have create golang api with viper i can add oauth2 for the code following the next git repo https://github.com/go-oauth2/oauth2 but i need to reuse the access_token in the api

so when i run in the browser http://34.212.136.167:9096/token?grant_type=client_credentials&client_id=000000&client_secret=999999

the output is {"access_token":"BLYCHNALOMEZUG_MFNS8YW","expires_in":7200,"token_type":"Bearer"}

i need to use the access_token in the url like http://34.212.136.167:9096/api?token=access_token=BLYCHNALOMEZUG_MFNS8YW& <rest of api >

thanks


评论:

ramzy0x:

i need to make it like this https://go.hotlibs.com/github.com/go-oauth2/gin-server/package

this using gin-server , i need to use it in http.HandleFunc


入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

639 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传