> ## 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

> Retrieve an OpenID device grant code that the Ocient System can verify and use with the sso_device_grant_verify endpoint.

The device grant process is intended for devices with limited input capabilities or no web browser:

1. Call this endpoint to retrieve a user code and verification URI.
2. Display the user code and verification URI to the user.
3. The user visits the verification URI on another device and enters the code.
4. Call the sso_device_grant_verify endpoint to check if the user has completed verification.



## OpenAPI

````yaml /openapi/generated-api-methods.json POST /v1/sso_device_grant
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:
    post:
      tags:
        - Ocient HTTP Query API
      summary: sso_device_grant
      description: >-
        Retrieve an OpenID device grant code that the Ocient System can verify
        and use with the sso_device_grant_verify endpoint.


        The device grant process is intended for devices with limited input
        capabilities or no web browser:


        1. Call this endpoint to retrieve a user code and verification URI.

        2. Display the user code and verification URI to the user.

        3. The user visits the verification URI on another device and enters the
        code.

        4. Call the sso_device_grant_verify endpoint to check if the user has
        completed verification.
      operationId: postOcientHttpQueryApiSsoDeviceGrant
      parameters: []
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                database:
                  type: string
                  description: >-
                    Target database name. If you do not specify this parameter,
                    the request defaults this value to system. This value
                    represents the database where the user connects after
                    completing the device grant process.
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  verification_uri_complete:
                    type: string
                  verification_uri:
                    type: string
                  user_code:
                    type: string
                  status:
                    type: object
                    properties:
                      reason:
                        type: string
                      sql_state:
                        type: string
                      vendor_code:
                        type: integer
              examples:
                response:
                  value:
                    verification_uri_complete: https://auth.example.com/device?code=BCDFGHJK
                    verification_uri: https://auth.example.com/device
                    user_code: BCDFGHJK
                    status:
                      reason: Device authorization initiated
                      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 \
                -H "Content-Type: application/json" \
                -d '{
                    "database": "retail_analytics"
                }'

````