swagger: '2.0' info: title: Central authentication service API description: Central authentication service via API. version: "0.1.1" # the domain of the service host: 127.0.0.1:8022 # array of all schemes that your API supports schemes: # TODO: Change to HTTPS when not on localhost! - http # will be prefixed to all paths #basePath: /rmaapp consumes: - application/json produces: - application/json securityDefinitions: api_key: type: apiKey name: Authorization in: header paths: /authenticate/: post: summary: Authenticate a user. description: | Authenticate a user. security: - api_key: [] parameters: - name: username in: formData description: Username required: false type: string - name: password in: formData description: Password required: false type: string - name: session_key in: formData description: session_key required: false type: string tags: - Authentication responses: 200: description: Result of the authentication process schema: $ref: '#/definitions/AuthenticationResp' default: description: Unexpected error schema: $ref: '#/definitions/Error' /api-token-auth/: post: summary: Get the authentification token for a user. description: | Get the authentification token for a user by providing his username and password. No authentification is required; however the credentials of the user are part of the request. parameters: - name: data in: body description: User credentials required: true schema: $ref: '#/definitions/Credentials' tags: - Users responses: 200: description: The authentification token of the user schema: $ref: '#/definitions/TokenResp' default: description: Unexpected error schema: $ref: '#/definitions/Error' definitions: User: type: object properties: id: type: integer description: Unique identifier representing a specific user username: type: string description: Name given to the user first_name: type: string description: First name of the user last_name: type: string description: Last name of the user email: type: string description: Email of the user is_staff: type: integer description: Boolean stating wether the user is a staff member or not is_superuser: type: integer description: Boolean stating wether the user is a superuser or not is_active: type: integer description: Boolean stating wether the user is active or not date_joined: type: string format: date-time description: Date and time of creation of the user UserPost: type: object required: - username - password properties: username: type: string description: Name given to the user password: type: string description: Password of the user first_name: type: string description: First name of the user last_name: type: string description: Last name of the user email: type: string description: Email of the user UserPatch: type: object properties: username: type: string description: Name given to the user password: type: string description: Password of the user first_name: type: string description: First name of the user last_name: type: string description: Last name of the user email: type: string description: Email of the user Error: type: object properties: detail: type: string TokenResp: type: object properties: token: type: string AuthenticationResp: type: object properties: response: type: boolean token: type: string Credentials: type: object required: - username - password properties: username: description: Username of the user type: string password: description: Password of the user type: string