> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ocient.com/llms.txt
> Use this file to discover all available pages before exploring further.

# sso_device_grant_verify

> Verify a previous device grant request and return an authorization token.

After initiating a device grant process with the sso_device_grant endpoint, use this endpoint to check if the user has completed the verification process. If the verification is successful, the endpoint returns an authorization token that you can use for subsequent API calls.

You can call this endpoint multiple times until one of these outcomes:

The user completes the verification (returns 200 OK with a token).

The timeout is reached (returns error).
 
The verification is canceled (returns error).



## OpenAPI

````yaml /openapi/generated-api-methods.json POST /v1/sso_device_grant_verify
openapi: 3.1.0
info:
  title: Generated API methods
  version: 1.0.0
  description: Generated from imported ApiMethodV2 blocks.
servers:
  - url: https://{sql_node}
    variables:
      sql_node:
        default: sql_node
  - url: http://oc1-lts0:9090
security: []
paths:
  /v1/sso_device_grant_verify:
    post:
      tags:
        - Ocient HTTP Query API
      summary: sso_device_grant_verify
      description: >-
        Verify a previous device grant request and return an authorization
        token.


        After initiating a device grant process with the sso_device_grant
        endpoint, use this endpoint to check if the user has completed the
        verification process. If the verification is successful, the endpoint
        returns an authorization token that you can use for subsequent API
        calls.


        You can call this endpoint multiple times until one of these outcomes:


        The user completes the verification (returns 200 OK with a token).


        The timeout is reached (returns error).
         
        The verification is canceled (returns error).
      operationId: postOcientHttpQueryApiSsoDeviceGrantVerify
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                user_code:
                  type: string
                  description: >-
                    The user code returned from a previous device grant request
                    using the sso_device_grant endpoint.
                database:
                  type: string
                  description: >-
                    Target database name. If you do not specify this parameter,
                    the request defaults this value to system.
                timeout:
                  type: string
                  description: >-
                    The verification timeout, in seconds, indicates how long the
                    server waits for the user to complete the device
                    authorization process before returning a timeout error.


                    The default value is 30 seconds. 


                    The valid range is 1-600 seconds (10 minutes).
              required:
                - user_code
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  access_token:
                    type: string
                  username:
                    type: string
                  database:
                    type: string
                  status:
                    type: object
                    properties:
                      reason:
                        type: string
                      sql_state:
                        type: string
                      vendor_code:
                        type: integer
              examples:
                response:
                  value:
                    access_token: >-
                      eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJqZG9lIiwiZGIiOiJyZXRhaWxfYW5hbHl0aWNzIiwiZXhwIjoxNjM1NDYxNzEyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
                    username: jdoe
                    database: retail_analytics
                    status:
                      reason: Authentication successful
                      sql_state: '00000'
                      vendor_code: 0
      servers:
        - url: https://{sql_node}
          variables:
            sql_node:
              default: sql_node
      x-codeSamples:
        - lang: curl
          label: curl
          source: |-
            curl -X POST https://my_sql_node.com/v1/sso_device_grant_verify \
                -H "Content-Type: application/json" \
                -d '{
                    "user_code": "BCDFGHJK",
                    "timeout": 60,
                    "database": "retail_analytics"
                }'

````