Oreborous

swagger-auth-webs5

Mar 20th, 2020
429
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 2.11 KB | None | 0 0
  1. paths:
  2.   /auth/token:
  3.     get:
  4.       tags:
  5.        - Auth
  6.       summary: Verify a 3rd party auth code and return an access token
  7.       parameters:
  8.         - in: query
  9.           name: provider
  10.           schema:
  11.             type: string
  12.           required: true
  13.           description: The name of the 3rd party provider
  14.         - in: query
  15.           name: code
  16.           schema:
  17.             type: string
  18.           required: true
  19.           description: The code of the 3rd party provider to verify
  20.       responses:
  21.         200:
  22.           description: The code was valid and we found/created a user
  23.           content:
  24.             application/json:
  25.               schema:
  26.                 $ref: '#/components/schemas/AuthTokenResponse'
  27.         400:
  28.           description: An error occured during verification
  29.           content:
  30.             application/json:
  31.               schema:
  32.                 $ref: '#/components/schemas/SimpleMessageResponse'
  33.     post:
  34.       tags:
  35.        - Auth
  36.       summary: Verify a user's credentials and return an access token
  37.       requestBody:
  38.         required: true
  39.         content:
  40.           application/json:
  41.             schema:
  42.               type: object
  43.               properties:
  44.                 username:
  45.                   type: string
  46.                 password:
  47.                   type: string
  48.       responses:
  49.         200:
  50.           description: The credentials are valid
  51.           content:
  52.             application/json:
  53.               schema:
  54.                 $ref: '#/components/schemas/AuthTokenResponse'
  55.         400:
  56.           description: An error occured during verification
  57.           content:
  58.             application/json:
  59.               schema:
  60.                 $ref: '#/components/schemas/SimpleMessageResponse'
  61.     delete:
  62.       tags:
  63.        - Auth
  64.       summary: Remove a user's token, A.K.A. sign out
  65.       security:
  66.         - Bearer: []
  67.       responses:
  68.         200:
  69.           description: Successful sign out
  70.           content:
  71.             application/json:
  72.               schema:
  73.                 $ref: '#/components/schemas/SimpleMessageResponse'
Advertisement
Add Comment
Please, Sign In to add comment