L5Swagger Laravel Bearer Token Authentication while Api Testing on Swagger

1.4k Views Asked by At

l5Swagger.php

 'securityDefinitions' => [

        'securitySchemes' => [    

                'bearerAuth' => [ // Unique name of security
                       'type' => 'http', 
                       'description' => 'A short description for oauth2 security 
                       'scheme'=> 'bearer',
                       'in' => 'header',
                       'bearerAuth' => 'bearerAuth',
                       'bearerFormat'=> 'JWT'
               
                  ],
                'security' => [
                       'bearerAuth' => ['bearerAuth']
                  ],
       ],

],

After adding Token and authorizing from Swagger UI When I execute any api, it starts loading and never ends. I followed all the instructions from darkaonline and open3.0 but still issue persists.

1

There are 1 best solutions below

0
Plínio Almeida On

Could you please try it like this?

'securityDefinitions' => [

    'securitySchemes' => [    

            'bearerAuth' => [ // Unique name of security
                   'type' => 'http', 
                   'description' => 'A short description for oauth2 security 
                   'scheme'=> 'bearer',
                   'in' => 'header',
                   'bearerAuth' => 'bearerAuth',
                   'bearerFormat'=> 'JWT'
           
              ],
            'security' => [
                   'bearerAuth' => []
              ],
   ],

],