Casdoor Authentication API

Login, callback, and device authorization

OpenAPI Specification

casdoor-authentication-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Casdoor REST Applications Authentication API
  description: 'Casdoor is an open-source IAM/SSO platform exposing a RESTful API for managing

    users, organizations, applications, roles, permissions, sessions, and OIDC/OAuth

    flows. This best-effort OpenAPI is derived from the public Swagger published at

    https://door.casdoor.com/swagger/ and the documentation at https://casdoor.ai/docs/.

    '
  version: 1.503.0
  contact:
    name: Casdoor (Casbin)
    email: casbin@googlegroups.com
    url: https://casdoor.ai/
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
servers:
- url: https://door.casdoor.com
  description: Casdoor public demo instance
- url: https://{host}
  description: Self-hosted Casdoor instance
  variables:
    host:
      default: localhost:8000
security:
- bearerAuth: []
- basicAuth: []
tags:
- name: Authentication
  description: Login, callback, and device authorization
paths:
  /api/login:
    post:
      tags:
      - Authentication
      summary: Login a user
      operationId: login
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                application:
                  type: string
                organization:
                  type: string
                username:
                  type: string
                password:
                  type: string
                type:
                  type: string
      responses:
        '200':
          description: Authenticated session
  /api/signup:
    post:
      tags:
      - Authentication
      summary: Sign up a new user
      operationId: signup
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/User'
      responses:
        '200':
          description: Signup result
  /api/logout:
    post:
      tags:
      - Authentication
      summary: Log out the current user
      operationId: logout
      responses:
        '200':
          description: Logout success
  /api/device-auth:
    post:
      tags:
      - Authentication
      summary: OAuth 2.0 device authorization
      operationId: deviceAuth
      responses:
        '200':
          description: Device authorization response
components:
  schemas:
    User:
      type: object
      properties:
        owner:
          type: string
        name:
          type: string
        displayName:
          type: string
        email:
          type: string
        phone:
          type: string
        avatar:
          type: string
        password:
          type: string
        type:
          type: string
        createdTime:
          type: string
          format: date-time
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
    basicAuth:
      type: http
      scheme: basic