# User Authentication

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /oauth/token:
    post:
      summary: User Authentication
      deprecated: false
      description: >-
        1. Get userName and password from enkash 

        2. Call auth token Api to generate Bearer token

        3. Bearer token has expiry of 5 min and refresh token will be valid for
        5 min . It will require regeneration once expired. 

        4. Distribution Platform verifies the identity of each Oauth2.0 API
        request, and whether the call parameters are valid. After 3 consecutive
        incorrect attempts, the account will be locked. Invalid response 
      tags:
        - 'Rewards & Incentives/APIs - Reward/Redemption '
      parameters:
        - name: Authorization
          in: header
          description: ''
          required: true
          example: >-
            Basic
            Q0VLMUdaQk82QTo2NGIwZmYwMzMyZjA1OGI1NjQwMmI2M2E5YmFhNjAyMTRmMmQ2MWQz
          schema:
            type: string
        - name: Content-Type
          in: header
          description: ''
          required: true
          example: application/x-www-form-urlencoded
          schema:
            type: string
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                username:
                  example: '9985379680'
                  type: string
                pin:
                  example: '123456'
                  type: string
                grant_type:
                  example: password
                  type: string
                clientId:
                  example: CEKIMP7F3L
                  type: string
              required:
                - username
                - pin
                - grant_type
                - clientId
            examples: {}
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  access_token:
                    type: string
                  token_type:
                    type: string
                  refresh_token:
                    type: string
                  expires_in:
                    type: integer
                  scope:
                    type: string
                required:
                  - access_token
                  - token_type
                  - refresh_token
                  - expires_in
                  - scope
                x-apidog-orders:
                  - access_token
                  - token_type
                  - refresh_token
                  - expires_in
                  - scope
              example:
                access_token: bCFIP675fIyGKIf6CWak43LF1rI
                token_type: bearer
                refresh_token: i2UQSYGeDZPogy_V6szNOi5Q0W0
                expires_in: 86399
                scope: read write trust
          headers: {}
          x-apidog-name: Success
      security:
        - basic: []
      x-apidog-folder: 'Rewards & Incentives/APIs - Reward/Redemption '
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/616243/apis/api-9820863-run
components:
  schemas: {}
  securitySchemes:
    basic:
      type: http
      scheme: basic
servers:
  - url: https://ekpayout-uat.enkash.in
    description: Testing Env
security: []

```
