Polygon ID Auth API

The Auth API from Polygon ID — 3 operation(s) for auth.

OpenAPI Specification

polygon-id-auth-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: Privado ID - Issuer Agent Auth API
  description: "The Issuer Node Core API is ideal for users who need multiple identities and for integrator profiles, who want to \ncreate solutions based on Privado ID functionalities and might be interested in having access to low level \ninformation such as Merkle Trees.\nThe Issuer Node API provide the following functionalities:\n* Create and retrieve Identities\n* Create a Verifiable Credential (VC)\n* Retrieve a Verifiable Credential or a list of Verifiable Credentials\n* Generate JSON to create a QR Code and use that to accept credentials in a wallet\n* Revoke a Verifiable Credential\n* Check revocation status of a Verifiable Credential\n* Retrieve the Revocation Status of a Verifiable Credential\n* Call Agent Endpoint using the Wallet App\n* Handle connections.\n"
  version: '1'
tags:
- name: Auth
paths:
  /v2/authentication/sessions/{id}:
    get:
      summary: Get Authentication Connection
      operationId: getAuthenticationConnection
      description: get authentication connection
      parameters:
      - $ref: '#/components/parameters/id'
      tags:
      - Auth
      security:
      - basicAuth: []
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetAuthenticationConnectionResponse'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
  /v2/{identifier}/authentication:
    post:
      summary: Get Authentication Message
      operationId: Authentication
      description: This endpoint returns an authentication message
      tags:
      - Auth
      parameters:
      - $ref: '#/components/parameters/pathIdentifier'
      - name: type
        in: query
        required: false
        description: "Type:\n  * `link` - (default value) Return a link redirection to the raw content. Easier to scan.   \n  * `raw` - Return the raw QR code.\n"
        schema:
          type: string
          enum:
          - raw
          - link
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthenticationResponse'
        '400':
          $ref: '#/components/responses/400'
        '500':
          $ref: '#/components/responses/500'
  /v2/authentication/callback:
    post:
      summary: Authentication Callback
      operationId: authCallback
      description: This endpoint is called when the QR code is scanned and the user is authenticated. A connection is created.
      tags:
      - Auth
      parameters:
      - $ref: '#/components/parameters/sessionID'
      requestBody:
        required: true
        content:
          text/plain:
            schema:
              type: string
              example: jwz-token
      responses:
        '200':
          description: ok
        '400':
          $ref: '#/components/responses/400'
        '500':
          $ref: '#/components/responses/500'
components:
  schemas:
    TimeUTC:
      type: string
      x-go-type: timeapi.Time
      x-go-type-import:
        name: timeapi
        path: github.com/polygonid/sh-id-platform/internal/timeapi
      example: '2023-10-26T10:59:08Z'
      x-omitempty: false
    AuthenticationResponse:
      type: object
      required:
      - message
      - sessionID
      properties:
        message:
          type: string
          example: iden3comm://?request_uri=https%3A%2F%2Fissuer-demo.privado.id%2Fapi%2Fqr-store%3Fid%3Df780a169-8959-4380-9461-f7200e2ed3f4
        sessionID:
          $ref: '#/components/schemas/UUIDString'
    GenericErrorMessage:
      type: object
      required:
      - message
      properties:
        message:
          type: string
          example: Something happen
    GetAuthenticationConnectionResponse:
      type: object
      required:
      - connection
      properties:
        connection:
          $ref: '#/components/schemas/AuthenticationConnection'
    UUIDString:
      type: string
      x-omitempty: false
      example: b7144f1c-d54e-4f67-a4f1-f2e7ff1beb07
    AuthenticationConnection:
      type: object
      required:
      - id
      - userID
      - issuerID
      - createdAt
      - modifiedAt
      properties:
        id:
          $ref: '#/components/schemas/UUIDString'
        userID:
          $ref: '#/components/schemas/UUIDString'
        issuerID:
          $ref: '#/components/schemas/UUIDString'
        createdAt:
          $ref: '#/components/schemas/TimeUTC'
        modifiedAt:
          $ref: '#/components/schemas/TimeUTC'
  parameters:
    sessionID:
      name: sessionID
      in: query
      required: true
      description: 'Session ID e.g: 89d298fa-15a6-4a1d-ab13-d1069467eedd

        '
      schema:
        type: string
        x-go-type: uuid.UUID
        x-go-type-import:
          name: uuid
          path: github.com/google/uuid
    id:
      name: id
      in: path
      required: true
      description: 'UUID parameter, e.g: 8edd8112-c415-11ed-b036-debe37e1cbd6

        '
      schema:
        type: string
        x-go-type: uuid.UUID
        x-go-type-import:
          name: uuid
          path: github.com/google/uuid
    pathIdentifier:
      name: identifier
      in: path
      required: true
      description: Issuer identifier
      schema:
        type: string
  responses:
    '404':
      description: Not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/GenericErrorMessage'
    '400':
      description: Bad Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/GenericErrorMessage'
    '500':
      description: Internal Server  error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/GenericErrorMessage'
    '401':
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/GenericErrorMessage'
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic