doutan2111 2016-07-20 16:44
浏览 92
已采纳

使用auth0向邮递员获取登录访问令牌

I created an app in Go that includes https server with angular2 based client that uses auth0 for authentication, I have another app written in Go which is the API Server, this API Server has jwt middleware configured for auth0 at explained at https://auth0.com/docs/quickstart/backend/golang.

now... I want to use postman to test requests o my API Server but first I need to authenticate. how do I add authentication to my website to get an access token or something to forward with my API request?

I read the docs but I got really confused. any information regarding the issue would be greatly appreciated.

Using Postman Mac App 4.4.2

thanks!

update

so I installed Authentication API Collections on my Postman Mac App while being logged in to my auth0 account.

now I'm trying to get an access token to be used with the authentication header while posting to my Api Server.

I don't know which method I should use in the collection in order to get an access token.

  • 写回答

3条回答 默认 最新

  • dqfr90979 2017-02-21 07:27
    关注

    It's quite interesting and tricky at the same time :)

    First you need to get the token from Auth0 using Postman, remember you can get any info from App Settings in Auth0 enter image description here

    In above picture, you see id_token and access_token. The trick here is to use Id_token to send with your requests, not Access_token. Do it as follow: enter image description here

    As you can see, for any request sending to API, we need to add a header called Authorization with value="Bearer {id_token}". Boom...Job's done :) Hope it helps

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥20 测距传感器数据手册i2c
  • ¥15 RPA正常跑,cmd输入cookies跑不出来
  • ¥15 求帮我调试一下freefem代码
  • ¥15 matlab代码解决,怎么运行
  • ¥15 R语言Rstudio突然无法启动
  • ¥15 关于#matlab#的问题:提取2个图像的变量作为另外一个图像像元的移动量,计算新的位置创建新的图像并提取第二个图像的变量到新的图像
  • ¥15 改算法,照着压缩包里边,参考其他代码封装的格式 写到main函数里
  • ¥15 用windows做服务的同志有吗
  • ¥60 求一个简单的网页(标签-安全|关键词-上传)
  • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法