我想把招摇与laravel护照联系起来。我昂首阔步的配置文件设置
'passport' => [ // Unique name of security
'type' => 'oauth2', // The type of the security scheme. Valid values are "basic", "apiKey" or "oauth2".
'description' => 'Laravel passport oauth2 security.',
'in' => 'header',
'scheme' => 'https',
'flows' => [
"password" => [
"authorizationUrl" => config('app.url') . '/oauth/authorize',
"tokenUrl" => config('app.url') . '/oauth/token',
"refreshUrl" => config('app.url') . '/token/refresh',
"scopes" => []
],
],
],
在使用注释的laravel控制器中
/**
* @OA\Post(
* path="/beauty/list-customer-service-bookings",
* tags={"beauty_customer_bookings"},
* summary="List Customer Bookings.",
* operationId="Beauty_Customer_Bookings",
* security={{"passport": {}}},
* @OA\SecurityScheme(
* securityScheme="https",
* type="oauth2",
* in="header",
* name="api_key"
* ),
*
* @OA\Parameter(
* name="customer_id",
* in="query",
* description="customer id",
* required=true,
* @OA\Schema(
* type="integer",
* default="482"
* )
* ),
* @OA\Response(
* response=422,
* description="validation errors."
* ),
* @OA\Response(
* response="200",
* description="Customer Bookings."
* ),
* @OA\Response(
* response="401",
* description="auth failed."
* ),
* @OA\Response(
* response="404",
* description="Page not found."
* ),
* )
*/
它没有发送应有的标头。我做错了什么或缺少什么吗?我需要this的解决方案,但是在Laravel中用招摇的OA 3
答案 0 :(得分:0)
security={
{"passport": {}},
},
谢谢。