DarkaOnLine / L5-Swagger

OpenApi or Swagger integration to Laravel
https://github.com/DarkaOnLine/L5-Swagger
MIT License
2.65k stars 396 forks source link

Laravel Sanctum cookie #289

Closed marcellorg closed 2 years ago

marcellorg commented 4 years ago

Description:

How to use the l5-swagger with Laravel sanctum?

Steps To Reproduce:


 * @SWG\Swagger(
 *     schemes={"https","http"},
 *     host=L5_SWAGGER_CONST_HOST,
  *    @SWG\SecurityScheme(
 *         securityDefinition="Bearer",
 *         type="apiKey",
 *         name="Authorization",
 *         in="header",
 *     ),
 *     @SWG\Info(
 *         version="2.0.0",
 *         title="FormGo Api",
 *         description="FormGo API description",
 *     )
 * )
 */
class Controller extends BaseController
{
    use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
}```

```    /**
    * @SWG\Post(
    *   path="/formgo/api/v2/painel/login",
    *   tags={"Authorization"},
    *   summary="Post login painel",
    *   consumes={"multipart/form-data"},
    *   produces={"text/plain, application/json"},
    *   operationId="login",
    *       @SWG\Parameter(
    *          name="email",
    *          in="formData",
    *          type="string",
    *          required=true,
    *          description="The user name for login",
    *      ),
    *       @SWG\Parameter(
    *          name="password",
    *          in="formData",
    *          type="string",
    *          required=true, 
    *          format="password",
    *          description="The passwor for login",
    *      ),
    *   @SWG\Response(response=201, description="successful login"),
    *   @SWG\Response(response=404, description="incorrect credentials"),
    * )
    *
    */
    public function loginPainel(Request $request, CriptografiaBesser $criptografiaBesser)
    {```

<bountysource-plugin>

---
Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/92011869-laravel-sanctum-cookie?utm_campaign=plugin&utm_content=tracker%2F13655492&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F13655492&utm_medium=issues&utm_source=github).
</bountysource-plugin>
DarkaOnLine commented 4 years ago

You have to be more specific what kind of issues you have if you want to get help.

ianrussel commented 4 years ago

Same here... @DarkaOnLine my spa is consuming api using Sanctum auth. However for stateful authentication, sanctum does not require bearer token, any ideas how to authenticate with sanctum ?

DarkaOnLine commented 4 years ago

Nope, I never used Sanctum :(

DarkaOnLine commented 2 years ago

Closing due to no activity for a very long time