openapi: 3.0.1
info:
  title: JWT Authentication
  description: "## JWTs (Json Web Tokens)\n### Access token\nAn Access [JWT](https://jwt.io/) is used for authentication and authorization:\n* Authentication requires verifying the signature of the Access JWT. If the signature is valid, access to the requested API resource is granted.\n* Authorization is done by looking up privileges within the scope attribute of the Access JWT. For this, you must first obtain the Access JWT and then enter it into the `Authorization` header of each API call. The value of the `Authorization` looks like this: `Bearer eyJhbGciOiJSUzI1NiIs.....`\n\n### Refresh Token\nA Refresh token is a long-lived token that you use to request new Access tokens. Its expiration time is longer than that of an Access token.\n\n## List of available APIs\n\n|Operation| \tHTTP Request| \tResource Request| \tDescription|\n|--|--|--|--|\n|getUserToken|`POST /iam/tokens`|[TokenRequest](https://nexway.stoplight.io/docs/nx-api-docs/reference/nx-iap-keycloack.json/components/schemas/TokenRequest)|\tGet/refresh a token|\n|invalidateToken|`DELETE /iam/tokens/invalidate`|\t|\tInvalidate a token|\n|resetUsingDELETE| \t`DELETE /iam/tokens/reset`||\treset|\n\n## How to\n\nNexway provides a POST [getUserToken](https://nexway.stoplight.io/docs/nx-api-docs/reference/nx-iap-keycloack.json/components/schemas/AccessToken) endpoint to get and refresh JWTs.\nYou can get a token two different ways:\n* By using realm name, client secret, and by specifying the grant type in *client_credentials*, if using an application interface.\n* By using realm name, username, password, and by specifying the grant type in *password*, if you are a human user.\n\n### Grant type \"client_credentials\" sample request\n\n```json\n{\n  \"clientSecret\": \"XXX-XXX-XXX-XXX\",\n  \"realmName\": \"com2us\",\n  \"grantType\": \"client_credentials\"\n}\n```\n\n### Grant type \"password\" sample request\nIn this case, \"grantType\" is not mandatory, since the default value is \"password\".\n```json\n{\n  \"username\": \"jdoe\",\n  \"password\": \"987654321\",\n  \"realmName\": \"com2us\"\n}\n```\n\n### Sample response\n```json\n{\n  \"access_token\": \"eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJzUlFuM0J4ZnRDakd0dTVBR0lEZkIyQ0pnQVprMnpwN1R2UGpp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H5YCW2R8CGVyeImldqVydyRZZ6urZbDrPkL1l0U0VtYv_a_NsrbeP-RLKFdmUMca5qIrhrZh-bbztrUyyq-aoUwQ\",\n  \"not-before-policy\": 0,\n  \"session_state\": \"371a7b3b-6a24-479b-89ee-048e7da736b5\"\n}\n```\n\n\nGoing forward, use a Refresh token to extend your session instead of using client secret to get a new Access token (and thus creating a new session) each time. However, as a Refresh token also has an expiration time, you will need use client secret when you request a new Refresh token.\n\n### Sample refresh request\n```json\n{\n  \"realmName\": \"com2us\",\n  \"grantType\": \"refresh_token\",\n  \"refreshToken\": \"eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJzUlFuM0J4ZnRDakd0dTVBR0lEZkIyQ0pnQVprMnpwN1R2UGppc2JSN3NJIn0.eyJqdGkiOiI1ZTQ5OWM3OC0wYzc0LTQ5NWQtOGIxMy0zZGVkYTAxODg1OTMiLCJleHAiOjE1MDY1ODg4MTUsIm5iZiI6MCwiaWF0IjoxNTA2NTg3MDE1LCJpc3MiOiJodHRwOi8va2V5Y2xvYWs6ODA4MC9hdXRoL3JlYWxtcy9jb20ydXMiLCJhdWQiOiJuZXh3YXktY2VudGVyIiwic3ViIjoiMjhlNDU4MjYtNDlhYy00N2FmLWFkMTMtZmI5NjUyNGRiYWE5IiwidHlwIjoiUmVmcmVzaCIsImF6cCI6Im5leHdheS1jZW50ZXIiLCJhdXRoX3RpbWUiOjAsInNlc3Npb25fc3RhdGUiOiI4MmI3NzE3OS05MGViLTQxMGEtYTBmNC1hYjM4OTQ0NWQ0ZmEiLCJjbGllbnRfc2Vzc2lvbiI6IjI1MjBhOWRlLWRhN2MtNDg5OS05ODdhLTEyYTVjM2I4NzM4MiIsInJlYWxtX2FjY2VzcyI6eyJyb2xlcyI6WyJhZG1pbiIsInVtYV9hdXRob3JpemF0aW9uIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnsiY2FydC1zZXJ2aWNlIjp7InJvbGVzIjpbInBvc3QiLCJn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l1KZY5fsSlRJXh3PZQcyU4_mSIZiIXMaFKH8WMOWbW6stnLSZMdPMLpwHIIlL14FOMifsz3nkacIk3L8ZIfZcXXn-jGNHJ0N_Toh15JTp_jbDfiaX-n7vNfurggQ8kHUrMXUDfXmB-vJbKgvc7uwKOLsopkVPXehq_FYMdst_oAqBWQzAFH1726S1XKINcluAtp_7ItYkNTZMgKH44vuBsu4EewvJE6hQw_TrzTSEz1ozDKbPQIrbbR0GI3Dz4cmZuHfMVE7-_6PPzrXRzT1eh31NZO8hjh-_ghzp6Vw\"\n}\n```\n"
  license:
    name: Nexway License Version 1.0
  version: '1.0'
servers:
  - url: https://api.staging.nexway.build
    description: Generated server url
security:
  - Bearer:
      - read
      - write
paths:
  /iam/oauth2/tokens:
    post:
      tags:
        - GoogleToken
      summary: create/refresh a token
      description: Create or refresh a JWT token.
      operationId: createGoogleUserTokenWithBody
      parameters:
        - name: X-Real-Ip
          in: header
          required: false
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProviderTokenRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccessToken'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccessToken'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccessToken'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccessToken'
        '500':
          description: Failure
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccessToken'
      x-operationWeight: '100'
  /iam/tokens/invalidate:
    delete:
      tags:
        - Token
      summary: Invalidate a token
      description: Invalidate a token from a user during a logout process
      operationId: invalidate
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
      responses:
        '204':
          description: No content
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not Found
        '500':
          description: Failure
      security:
        - none: []
      x-operationWeight: '200'
  /iam/tokens:
    post:
      tags:
        - Token
      summary: create/refresh a token
      description: Create a JWT token or refresh a new one.
      operationId: createUserTokenWithBody_2
      parameters:
        - name: X-Real-Ip
          in: header
          required: false
          schema:
            type: string
        - name: authorization
          in: header
          required: false
          schema:
            type: string
        - name: client_id
          in: query
          required: false
          schema:
            type: string
          description: Client id
        - name: client_secret
          in: query
          required: false
          schema:
            type: string
          description: Client secret
        - name: username
          in: query
          required: false
          schema:
            type: string
          description: User name
        - name: password
          in: query
          required: false
          schema:
            type: string
          description: Password
        - name: refresh_token
          in: query
          required: false
          schema:
            type: string
          description: Refresh token
        - name: grant_type
          in: query
          required: false
          schema:
            type: string
          description: >-
            Request type. Possible values are: password, refresh_token,
            client_credentials
        - name: scope
          in: query
          required: false
          schema:
            type: string
          description: Scope
        - name: realm
          in: query
          required: false
          schema:
            type: string
          description: Realm name
        - name: Authorization
          in: header
          required: false
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TokenRequest'
        required: true
        description: ''
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccessToken'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccessToken'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccessToken'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccessToken'
        '500':
          description: Failure
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccessToken'
      security:
        - none: []
      x-operationWeight: '100'
components:
  schemas:
    ProviderTokenRequest:
      type: object
      properties:
        scope:
          type: string
        username:
          type: string
        password:
          type: string
        realmName:
          type: string
        clientId:
          type: string
        clientSecret:
          type: string
        grantType:
          type: string
          enum:
            - password
            - refresh_token
            - client_credentials
            - end_user_credentials
            - google_login
        refreshToken:
          type: string
        customerId:
          type: string
        storeId:
          type: string
        tokenId:
          type: string
        firstName:
          type: string
        lastName:
          type: string
        email:
          type: string
        provider:
          $ref: '#/components/schemas/TokenProvider'
        refresh_token:
          type: string
          writeOnly: true
        realm:
          type: string
          writeOnly: true
        client_id:
          type: string
          writeOnly: true
        grant_type:
          type: string
          writeOnly: true
        client_secret:
          type: string
          writeOnly: true
    TokenProvider:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
    AccessToken:
      type: object
      properties:
        otherClaims:
          type: object
          additionalProperties:
            type: object
          writeOnly: true
        access_token:
          type: string
        expires_in:
          type: integer
          format: int64
        refresh_expires_in:
          type: integer
          format: int64
        refresh_token:
          type: string
        token_type:
          type: string
        id_token:
          type: string
        not-before-policy:
          type: integer
          format: int32
        session_state:
          type: string
    TokenRequest:
      type: object
      properties:
        scope:
          type: string
        username:
          type: string
        password:
          type: string
        realmName:
          type: string
        clientId:
          type: string
        clientSecret:
          type: string
        grantType:
          type: string
          enum:
            - password
            - refresh_token
            - client_credentials
            - end_user_credentials
            - google_login
        refreshToken:
          type: string
        customerId:
          type: string
        storeId:
          type: string
        refresh_token:
          type: string
          writeOnly: true
        realm:
          type: string
          writeOnly: true
        client_id:
          type: string
          writeOnly: true
        grant_type:
          type: string
          writeOnly: true
        client_secret:
          type: string
          writeOnly: true
  securitySchemes:
    Bearer:
      type: http
      description: Enter Bearer token
      scheme: bearer
      bearerFormat: JWT
