Back to top

For MSPs — Generate an access token for your Knox MSP Program tenant

Last updated April 30th, 2024

If you’re a third party portal provider and you’d like to make calls to Knox cloud service on behalf of your customers, see the integration guide for EMMs.

Complete these steps to generate your access token using the Knox Cloud Authentication API and successfully call the Knox cloud service APIs in the course of your MSP activities.

  1. Get access to Knox Cloud API:

    1. Register for a Knox Partner Program account as a Managed Service Provider.

    2. Contact your local Samsung representative or the Knox team through one of the following channels to request access:

      • On the Knox Partner Program dashboard, click Support and submit the web form.
      • On the Knox Developers dashboard, click Support > Technical Support.
  2. Generate your key pair on the Knox API Portal:

    1. On the Knox Developer Portal, click Knox Cloud API Portal.

    2. Click Download to download your public and private key pair JSON file. This JSON file only needs to be generated once and contains the following information:

      Key Description
      Public key Key that’s sent in the body of the accesstoken REST API request and stored by Samsung Knox to validate signed requests.
      Private key Key that should be stored and never revealed. This key is used for signing the Client Identifier and the access token returned by the REST API call. This key isn’t stored by Samsung Knox and we’ll never request it from you.
  3. Click GENERATE CLIENT IDENTIFIER under Knox MSP API. This unique identifier only needs to be generated once unless:

    • Privileges need to be changed.
    • The Client Identifier is lost or stolen.

    In both cases, re-generating the Client Identifier invalidates the previous one.

    Knox MSP Client identifier

  4. Get the support files.

  5. Sign your Client Identifier with the token utility. See the source code below on how to sign your Client Identifier. For more information on using this utility JAR, see the included README file in the JAR file download package.

  6. Generate your access token by calling the accesstoken REST API with your signed clientId and public key. The signed Client Identifier should be set as the value to clientIdentifierJwt in the request body of the accesstoken REST API. You can also set the token valid time between 1 — 30 minutes. The valid time is set to 30 minutes by default.

    For example:

  7. Sign your accesstoken with your private key, using the utility JAR file as seen below.

    The signed accesstoken expires after its valid time runs out. Once that happens it returns the 403225 error code.

  8. Enter your access token in the x-knox-apitoken header parameter of your Knox cloud service API request. See the API reference of your Knox cloud service for details. When you call a Knox cloud service API on behalf of your managed customers, you must include the x-wsm-managed-tenantid header parameter in your request, which identifies which customer you are managing with the API. Use your managed customer’s ID as its value, which is found on the Customers page on the Knox MSP Portal.

If you’re making a call to the Knox MSP Portal API, you don’t need to include the x-wsm-managed-tenantid header parameter.

Here is an example of how to detect when the access token expires, get a fresh access token, and call a Knox Cloud Service API again.

Is this page helpful?