Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/linq/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Unbale在Swagger hub上的api文档中为在Laravel上创建的api提供授权_Laravel_Authorization_Swagger - Fatal编程技术网

Unbale在Swagger hub上的api文档中为在Laravel上创建的api提供授权

Unbale在Swagger hub上的api文档中为在Laravel上创建的api提供授权,laravel,authorization,swagger,Laravel,Authorization,Swagger,无法在Swagger hub上的api文档中为在Laravel上创建的api提供授权。LaravelAPI使用授权承载令牌,我正在Swagger Hub中为其编写文档 我在swagger hub中提供了以下代码片段: components: securitySchemes: bearerAuth: # arbitrary name for the security scheme type: http sche

无法在Swagger hub上的api文档中为在Laravel上创建的api提供授权。LaravelAPI使用授权承载令牌,我正在Swagger Hub中为其编写文档

我在swagger hub中提供了以下代码片段:

components:
     securitySchemes:
        bearerAuth:            # arbitrary name for the security scheme
          type: http
          scheme: bearer
          bearerFormat: JWT    # optional, arbitrary value for documentation purposes
    security:
      - bearerAuth: []

但我没有得到任何区域来提供授权令牌。我是新来的大摇大摆枢纽,所以无法得到解决这个问题。我以为它会为我提供一个文本框,为授权提供不记名令牌,但它没有。需要这方面的帮助和指导。

主要要求是为需要访问令牌进行检查的api提供授权令牌。这就是我如何做到的

步骤1:我从components标签下面删除了这段代码,因为我不需要在所有api中使用它。 安全: -BeareAuth:[]

步骤2:我将安全标签放入需要访问令牌的api中。 路径: /客户/细分市场/列表/{venueId}: 获取: 安全: -BeareAuth:[]

步骤3:如果按钮显示为绿色,请单击“保存”按钮(表示一切正常)

第4步:点击文档链接,现在你会发现在“服务器”标签旁边出现一个名为“授权”的按钮,现在你需要点击它,放置你的访问令牌并授权,然后在swagger中检查测试你的Api。它会起作用的