Tutorial for customers — Generate access token
Last updated November 9th, 2023
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 service APIs.
Register for a Samsung Knox account
Follow the steps at Create a Samsung Knox account to create a Samsung Knox account.
Apply for Knox Cloud API access by contacting your local Samsung representative. If you can’t get access through a Samsung Knox representative, please create a support ticket. To submit a support ticket:
- Log in to the Knox Admin Portal.
- Under Support & dev resources, click Submit/view tickets.
- In the dialog that’s shown, click SUBMIT A SUPPORT TICKET.
Generate your key pair from the Knox Cloud API portal:
From the portal, generate a public/private key pair called keys.json by clicking Download. This is a JSON file that contains the following information. It only needs to be generated once:
- Public key — Key that is sent in the body of the access token REST API 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 is not stored by Samsung Knox and we will never request it from you.
* Access to Knox Cloud API portal is supported by the following browsers — Chrome, Firefox, Safari, and Microsoft Edge. In order to get the best possible Knox Cloud API experience, upgrade your preferred browser to the latest version.
Generate your unique Client Identifier from the Knox Cloud API portal. This unique identifier only needs to be generated once, unless either:
- Privileges need to be changed.
- The Client Identifier is lost or stolen.
In both cases, re-generating the Client identifier invalidates the previous one.
Get the support files
Sign your Client Identifier with the token utility supplied above. See the source code below on how to sign your Client Identifier. For more information on using this utility jar, refer to the included README file in the JAR file download package.
Generate your access token by calling the accesstoken REST API with your signed
public key. The signed Client Identifier should be set as the value to
clientIdentifierJwtin 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.
accesstokenwith your private key, using the utility JAR file as seen below.
accesstokenexpires after its valid time runs out. Once that happens it returns the
Enter your access token in the
x-knox-apitokenheader parameter of your Knox cloud service API request. See the API reference for your Knox cloud service for details.
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?
Thank you for your feedback!