Is the Nx Cloud up? Visit our Status Page for the current health and performance of the Nx Cloud.

Status Page

Authorization Bearer with Cloud Account

Answered

Comments

5 comments

  • Andrey Terentyev
    • Network Optix team

    Hi,

    While working with cloud, the http redirects often take place. I guess, It's you case. You need to retain authorization headers.

    Here is the thread explaining the issue and its solution.

    https://support.networkoptix.com/hc/en-us/community/posts/13995754937879-Unable-to-authenticate-with-token-for-API-requests-with-NxMeta-cloud

    0
  • Dylan Zumar

    Andrey Terentyev Thank you for your help! I can successfully authenticate and get information from the system now. Though I am wondering about permissions. When we get a new system what user permissions are required in order to connect via the method of the cloud relay?

    0
  • Andrey Terentyev
    • Network Optix team

    Cloud relay forwards all the API requests. The response depends on the user account permissions you invoke API with.

    0
  • Dylan Zumar

    Andrey Terentyev Thank you for your answer! I was wondering specifically which permissions are required for these functions:

    1. request_api(LOCAL_URL, '/rest/v1/system/info', 'GET', verify=False)
    2. request_api(LOCAL_URL, f'/rest/v1/login/users/{CLOUD_USER}', 'GET', verify=False)
    3. request_api(CLOUD_URL, f'/cdb/oauth2/token', 'POST', json=oauth_payload)
    4. request_api(LOCAL_URL, f'/rest/v1/login/sessions/{primary_token}', 'GET', verify=False)
    5. request_api(LOCAL_URL, f'/rest/v1/servers/*/info', 'GET',
                                  headers=primary_token_header, verify=False)
    6. requests.get('%s/ec2/getCamerasEx' % (LOCAL_URL), headers = primary_token_header)

    (from https://dwspectrum.digital-watchdog.com/docs/developers/knowledgebase/278-how-does-authentication-work)

    0
  • Andrey Terentyev
    • Network Optix team

    Hi,

    The permissions required for each API you can find in the API endpoint documentation, in the x-permission section.

    /ec2/getCamerasEx is deprecated. Use /rest/v2/devices instead.

    0

Please sign in to leave a comment.