Need help in oauth2 golang

xuanbao · · 346 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>i have create golang api with viper i can add oauth2 for the code following the next git repo <a href="https://github.com/go-oauth2/oauth2" rel="nofollow">https://github.com/go-oauth2/oauth2</a> but i need to reuse the access_token in the api </p> <p>so when i run in the browser <a href="http://34.212.136.167:9096/token?grant_type=client_credentials&amp;client_id=000000&amp;client_secret=999999" rel="nofollow">http://34.212.136.167:9096/token?grant_type=client_credentials&amp;client_id=000000&amp;client_secret=999999</a></p> <p>the output is {&#34;access_token&#34;:&#34;BLYCHNALOMEZUG_MFNS8YW&#34;,&#34;expires_in&#34;:7200,&#34;token_type&#34;:&#34;Bearer&#34;}</p> <p>i need to use the access_token in the url like <a href="http://34.212.136.167:9096/api?token=access_token=BLYCHNALOMEZUG_MFNS8YW&amp;" rel="nofollow">http://34.212.136.167:9096/api?token=access_token=BLYCHNALOMEZUG_MFNS8YW&amp;</a> &lt;rest of api &gt;</p> <p>thanks</p> <hr/>**评论:**<br/><br/>ramzy0x: <pre><p>i need to make it like this <a href="https://go.hotlibs.com/github.com/go-oauth2/gin-server/package" rel="nofollow">https://go.hotlibs.com/github.com/go-oauth2/gin-server/package</a></p> <p>this using gin-server , i need to use it in http.HandleFunc </p></pre>

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

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