Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/api/5.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
在Swagger API中使用Oauth_Api_Oauth_Swagger 2.0_Swagger Editor - Fatal编程技术网

在Swagger API中使用Oauth

在Swagger API中使用Oauth,api,oauth,swagger-2.0,swagger-editor,Api,Oauth,Swagger 2.0,Swagger Editor,我正在使用swagger构建API,到目前为止,我创建了get/insert/update和delete作业,现在我正在尝试使用Oauth来保护我的API 我用过 securityDefinitions: job_auth: type: oauth2 authorizationUrl: http://localhost:10010/auth flow: implicit scopes: write:jobs: modify jobs i

我正在使用swagger构建API,到目前为止,我创建了get/insert/update和delete作业,现在我正在尝试使用Oauth来保护我的API

我用过

securityDefinitions: 
  job_auth: 
    type: oauth2 
    authorizationUrl: http://localhost:10010/auth 
    flow: implicit 
    scopes: 
      write:jobs: modify jobs in your account 
      read:jobs: get your jobs
在我的/get函数中,我使用了 `路径:

在“大摇大摆”编辑器中,现在显示

保安 作业身份验证(OAuth 2.0)身份验证(按钮)

流隐式 授权URL

范围

写入:作业修改您帐户中的作业 阅读:工作得到你的工作

现在我想使用

但它给出了类似这样的东西

{ “消息”:“未知安全处理程序:作业\u身份验证”, “代码”:“服务器错误”, “状态代码”:403 }

有人能帮助我如何访问和设置
正确地在Oauth中进行身份验证,我是新来的

可能是您几个小时前问过这个问题的副本,然后将其删除并再次询问,对吗?请不要那样做。你可以随心所欲地编辑你的问题,但删除并重新询问以获得更多关注是禁止你的帐户的理由。注意:代表分数>10000的用户仍然可以看到您删除的问题。@Hack-R我删除了它,因为我认为它不清楚,所以我发布了新的问题,这就是@Hack-R提到编辑您的问题的功能的原因。:)可能是你几个小时前问过这个问题,然后把它删除,然后再问,对吗?请不要那样做。你可以随心所欲地编辑你的问题,但删除并重新询问以获得更多关注是禁止你的帐户的理由。注意:代表分数>10000的用户仍然可以看到您删除的问题。@Hack-R我删除了它,因为我认为它不清楚,所以我发布了新的问题,这就是@Hack-R提到编辑您的问题的功能的原因。:)
/jobs:
# binds a127 app logic to a route
x-swagger-router-controller: job
get:
  description: Returns the job list
  # used as the method name of the controller
  operationId: getAllJobs
  responses:
    "200":
      description: Success
      schema:
      $ref: "#/definitions/GetJobsListResponse"

  security:
    - job_auth:
      - read:jobs `