MasterTesh
3 years agoOccasional Contributor
cookies authentication
Hi everyone hope you are doing well,
I would like to achieve as below in c#, but I have no idea how to do it
- paths:
- /login:
- post:
- summary: Logs in and returns the authentication cookie
- requestBody:
- required: true
- description: A JSON object containing the login and password.
- content:
- application/JSON:
- schema:
- $ref: '#/components/schemas/LoginRequest'
- security: [] # no authentication
- responses:
- '200':
- description: >
- Successfully authenticated.
- The session ID is returned in a cookie named `JSESSIONID`. You need to include this cookie in subsequent requests.
- headers:
- Set-Cookie:
- schema:
- type: string
- example: JSESSIONID=abcde12345; Path=/; HttpOnly