onasty/api/paths/auth/oauth-provider-callback.yml (view raw)
Oleksandr Smirnov
Oleksandr Smirnov
olexsmir@gmail.com api: add openapi docs (#181)..., 9 months ago
olexsmir@gmail.com api: add openapi docs (#181)..., 9 months ago
| 1 | get: |
| 2 | tags: [OAuth] |
| 3 | summary: OAuth callback handler |
| 4 | security: |
| 5 | - {} |
| 6 | |
| 7 | parameters: |
| 8 | - name: provider |
| 9 | in: path |
| 10 | required: true |
| 11 | schema: |
| 12 | type: string |
| 13 | enum: [google, github] |
| 14 | |
| 15 | - name: code |
| 16 | in: query |
| 17 | required: true |
| 18 | description: Authorization code from OAuth provider |
| 19 | schema: |
| 20 | type: string |
| 21 | example: "4/0AX4XfWjYxT5..." |
| 22 | |
| 23 | - name: state |
| 24 | in: query |
| 25 | required: false |
| 26 | description: CSRF protection state parameter |
| 27 | schema: |
| 28 | type: string |
| 29 | |
| 30 | responses: |
| 31 | '200': |
| 32 | description: OAuth login successful |
| 33 | content: |
| 34 | application/json: |
| 35 | schema: |
| 36 | $ref: '../../components/schemas/JwtTokens.yml' |
| 37 | |
| 38 | # TODO: unimplemented |
| 39 | # '302': |
| 40 | # description: Redirect to frontend with tokens (alternative flow) |
| 41 | # headers: |
| 42 | # Location: |
| 43 | # description: Frontend URL with tokens as query params or hash |
| 44 | # schema: |
| 45 | # type: string |
| 46 | # example: "onasty.local/api/v1/auth/success?access=...&refresh=..." |
| 47 | |
| 48 | '400': |
| 49 | $ref: '../../components/responses/ErrorResponse.yml' |
| 50 | |
| 51 | '500': |
| 52 | $ref: '../../components/responses/ErrorResponse.yml' |