---
openapi: 3.0.3
info:
  title: saml-gateway API
  version: "2.0"
paths:
  /:
    get:
      tags:
      - Common Resource
      responses:
        "200":
          description: OK
          content:
            text/html:
              schema:
                type: string
  /SAML2/SLO:
    get:
      tags:
      - SLO Request Resource
      responses:
        "200":
          description: OK
  /SAML2/SSO:
    get:
      tags:
      - SSO Request Resource
      responses:
        "200":
          description: OK
    post:
      tags:
      - SSO Request Resource
      responses:
        "200":
          description: OK
  /api/rest/backend:
    get:
      tags:
      - Open Id Backend Resource
      parameters:
      - name: limit
        in: query
        schema:
          format: int32
          type: integer
      - name: query
        in: query
        schema:
          type: string
      - name: skip
        in: query
        schema:
          format: int32
          type: integer
      - name: sort-key
        in: query
        schema:
          type: string
      - name: sort-order
        in: query
        schema:
          type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/OpenIdBackend'
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      security:
      - SecurityScheme:
        - admin
    post:
      tags:
      - Open Id Backend Resource
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OpenIdBackend'
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OpenIdBackend'
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      security:
      - SecurityScheme:
        - admin
  /api/rest/backend-count:
    get:
      tags:
      - Open Id Backend Resource
      parameters:
      - name: query
        in: query
        schema:
          type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                format: int64
                type: integer
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      security:
      - SecurityScheme:
        - admin
  /api/rest/backend/{id}:
    get:
      tags:
      - Open Id Backend Resource
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OpenIdBackend'
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      security:
      - SecurityScheme:
        - admin
    delete:
      tags:
      - Open Id Backend Resource
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
      responses:
        "204":
          description: No Content
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      security:
      - SecurityScheme:
        - admin
  /api/rest/encryption-algorithms:
    get:
      tags:
      - Algorithm Resource
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AlgorithmsResult'
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      security:
      - SecurityScheme:
        - admin
  /api/rest/frontend:
    get:
      tags:
      - SAML Frontend Resource
      parameters:
      - name: limit
        in: query
        schema:
          format: int32
          type: integer
      - name: query
        in: query
        schema:
          type: string
      - name: skip
        in: query
        schema:
          format: int32
          type: integer
      - name: sort-key
        in: query
        schema:
          type: string
      - name: sort-order
        in: query
        schema:
          type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SAMLFrontend'
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      security:
      - SecurityScheme:
        - admin
    post:
      tags:
      - SAML Frontend Resource
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SAMLFrontend'
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SAMLFrontend'
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      security:
      - SecurityScheme:
        - admin
  /api/rest/frontend-count:
    get:
      tags:
      - SAML Frontend Resource
      parameters:
      - name: query
        in: query
        schema:
          type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                format: int64
                type: integer
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      security:
      - SecurityScheme:
        - admin
  /api/rest/frontend-template:
    get:
      tags:
      - SAML Frontend Resource
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SAMLFrontend'
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      security:
      - SecurityScheme:
        - admin
  /api/rest/frontend/{id}:
    get:
      tags:
      - SAML Frontend Resource
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SAMLFrontend'
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      security:
      - SecurityScheme:
        - admin
    delete:
      tags:
      - SAML Frontend Resource
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
      responses:
        "204":
          description: No Content
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      security:
      - SecurityScheme:
        - admin
  /api/rest/idp-settings:
    get:
      tags:
      - Settings Resource
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IdPSettings'
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      security:
      - SecurityScheme:
        - admin
    post:
      tags:
      - Settings Resource
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/IdPSettings'
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IdPSettings'
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      security:
      - SecurityScheme:
        - admin
  /api/rest/keytransport-algorithms:
    get:
      tags:
      - Algorithm Resource
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AlgorithmsResult'
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      security:
      - SecurityScheme:
        - admin
  /api/rest/signature-algorithms:
    get:
      tags:
      - Algorithm Resource
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AlgorithmsResult'
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      security:
      - SecurityScheme:
        - admin
  /api/rest/validate-metadata:
    post:
      tags:
      - SAML Frontend Resource
      parameters:
      - name: frontendId
        in: query
        schema:
          type: string
      requestBody:
        content:
          application/xml:
            schema:
              type: string
          text/xml:
            schema:
              type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetadataValidationResult'
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      security:
      - SecurityScheme:
        - admin
  /callback:
    get:
      tags:
      - SSO Response Resource
      parameters:
      - name: code
        in: query
        schema:
          type: string
      - name: error
        in: query
        schema:
          type: string
      - name: error_description
        in: query
        schema:
          type: string
      - name: state
        in: query
        schema:
          type: string
      responses:
        "200":
          description: OK
  /favicon.png:
    get:
      tags:
      - Common Resource
      responses:
        "200":
          description: OK
  /logo:
    get:
      tags:
      - Common Resource
      responses:
        "200":
          description: OK
  /metadata.xml:
    get:
      tags:
      - Common Resource
      responses:
        "200":
          description: OK
          content:
            text/xml:
              schema:
                type: string
components:
  schemas:
    ACLType:
      enum:
      - NAMESPACE
      - NAMESPACE_GROUP
      - GROUP
      - GROUP_PERMISSION
      - PERMISSION
      type: string
    AccessControl:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/ACLType'
        namespace:
          type: string
        group:
          type: string
        permission:
          type: string
    Algorithm:
      type: object
      properties:
        name:
          type: string
        value:
          type: string
    AlgorithmsResult:
      type: object
      properties:
        algorithms:
          type: array
          items:
            $ref: '#/components/schemas/Algorithm'
    IDClaim:
      enum:
      - ID
      - NAMESPACE
      - USERNAME
      - NAME
      - GIVEN_NAME
      - FAMILY_NAME
      - NICKNAME
      - SCREEN_NAME
      - EMAIL
      - EMAIL_VERIFIED
      - PHONE_NUMBER
      - PHONE_NUMBER_VERIFIED
      - LOCALE
      - GROUPS
      - ADDRESS_STREET
      - ADDRESS_LOCALITY
      - ADDRESS_REGION
      - ADDRESS_POSTAL_CODE
      - ADDRESS_COUNTRY
      - EXTERNAL_PERMISSIONS
      - CUSTOM
      - GROUPS_PROPERTY_CUSTOM
      type: string
    IdPSettings:
      type: object
      properties:
        id:
          type: string
        signingKey:
          type: string
        signingCertificate:
          type: string
        orgName:
          type: string
        orgDisplayName:
          type: string
        orgUrl:
          type: string
    KeyPlacement:
      enum:
      - PEER
      - INLINE
      type: string
    MetadataValidationResult:
      type: object
      properties:
        valid:
          type: boolean
        error:
          type: string
        encryptionSupported:
          type: boolean
        entityId:
          type: string
        duplicateEntityId:
          type: boolean
        validUntil:
          format: date-time
          type: string
        authnRequestsSigned:
          type: boolean
        wantAssertionsSigned:
          type: boolean
    ObjectId:
      type: object
      properties:
        timestamp:
          format: int32
          type: integer
        counter:
          format: int32
          type: integer
        randomValue1:
          format: int32
          type: integer
        randomValue2:
          type: integer
        date:
          format: date
          type: string
    OpenIdBackend:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/ObjectId'
        name:
          type: string
        description:
          type: string
        idUrl:
          type: string
        clientId:
          type: string
        clientSecret:
          type: string
        acrValues:
          type: string
    OutgoingClaim:
      type: object
      properties:
        input:
          $ref: '#/components/schemas/IDClaim'
        customInput:
          type: string
        output:
          type: string
    SAMLFrontend:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/ObjectId'
        name:
          type: string
        description:
          type: string
        enabled:
          type: boolean
        backendId:
          $ref: '#/components/schemas/ObjectId'
        metadata:
          type: string
        entityId:
          type: string
        validUntil:
          format: date-time
          type: string
        nameIdClaim:
          $ref: '#/components/schemas/IDClaim'
        claims:
          type: array
          items:
            $ref: '#/components/schemas/OutgoingClaim'
        claimsPassthrough:
          type: boolean
        adfsCompat:
          type: boolean
        accessList:
          type: array
          items:
            $ref: '#/components/schemas/AccessControl'
        signMessages:
          type: boolean
        encryptNameID:
          type: boolean
        encryptAssertion:
          type: boolean
        signatureAlgorithm:
          type: string
        encryptionAlgorithm:
          type: string
        keytransportAlgorithm:
          type: string
        keyPlacement:
          $ref: '#/components/schemas/KeyPlacement'
        assertionConsumerServiceUrlOverride:
          type: string
  securitySchemes:
    SecurityScheme:
      type: http
      description: Authentication
      scheme: basic
