<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&client_id=000000&client_secret=999999" rel="nofollow">http://34.212.136.167:9096/token?grant_type=client_credentials&client_id=000000&client_secret=999999</a></p>
<p>the output is
{"access_token":"BLYCHNALOMEZUG_MFNS8YW","expires_in":7200,"token_type":"Bearer"}</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&" rel="nofollow">http://34.212.136.167:9096/api?token=access_token=BLYCHNALOMEZUG_MFNS8YW&</a> <rest of api ></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
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传