{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["admonition","partial"]},"type":"markdown"},"seo":{"title":"Authentication","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"authentication","__idx":0},"children":["Authentication"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To use CDQ APIs, you must properly authenticate our services."," ","For authentication, you can use the API key or OAuth2 Client Credentials."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"prerequisites","__idx":1},"children":["Prerequisites"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["If your organization is already a CDQ customer, ask your internal point of contact to create a CDQ dedicated account. Account detail will be sent by email."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["If your organization is not yet a CDQ customer, please ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://www.cdq.ch/contact"},"children":["contact us"]}," to get started."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"step-1-api-key-management","__idx":2},"children":["Step 1: API Key Management"]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This step is common for both methods of authentication. The required type of authentication will be distinguished in the further steps."]}]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Log into the CDQ ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://apps.cdq.com"},"children":["Cloud Apps"]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/auth1.69ceac19aff9aec9330cc1beda18e5bf60d84699d415ea6b4be08c7ac393b369.6fde6558.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":2},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Navigate to the \"API Key Management\" App"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/auth2.bee47e195c36f2c2e70e3b10558c90c732bb61a3ed617eaa94b30520b00598b7.6fde6558.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If no API Key Management App is visible, contact your local admin for API Key creation."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"step-2-generate-the-authentication-details","__idx":3},"children":["Step 2: Generate the authentication details"]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":3},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Create a new API Key"]}," button"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Enter the name for the new API Key"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/auth4.cd75cd798f03dab4facc5c1b4420c85078a04c6d31787303a944309c6ea15119.6fde6558.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Now select authentication method: ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#api-key"},"children":["API Key"]}," or ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#oauth-20"},"children":["OAuth 2.0"]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"api-key","__idx":4},"children":["API Key"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Note down the generated ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["API Key"]}," is marked in the green box."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/auth5.a22863c71f00a00146db2e0b53e003bad855e307a983b77c466110aeb9ea6889.6fde6558.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Check the example:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"X-API-KEY: ZHNmd2Ratc2dzZ2RZ3NWqZHNnc2c2Rndmnc2dmZHazZ3NnZzZ3anZHM=\n"},"children":[]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":2},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Click the checkbox to confirm saving the API key and close the window."]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"warning"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The generated ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["API Key"]}," will be presented only once! The key cannot be recovered in case of loss. Consider saving ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Client ID"]}," , ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Client Secret"]}," as well."]}]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":3},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Go back to a desired API section in Developer-Portal"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/auth6.696fbb7a9e45b20a51fa44239dc4c520d2477895cae9aa6da9f3f32f944ac300.6fde6558.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":4},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Copy the provided API Key and paste it to the security box in the console"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/auth7.0d4fb05fa55bc16d828c76e9976f979930ffadb949cfc149a6617cc6518ab57d.6fde6558.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":5},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Set needed parameters and try it!"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"oauth-20","__idx":5},"children":["OAuth 2.0"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Note down the generated ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Client ID"]},"and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Client Secret"]}," are marked in the green box."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/auth3.24f4cf4d6618496ee78c1167937286850bede4fd48aa863f542f2dcb497c7006.6fde6558.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Check the example:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"Client ID: f1096473-7g01-42fa-b1c5-e747b987da61\nClient Secret: 5eg123cf6sp0g\n"},"children":[]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":2},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Click the checkbox to confirm saving the API key and close the window."]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"warning"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The generated ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Client ID"]},"and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Client Secret"]}," will be presented only once! The credentials cannot be recovered in case of loss. Consider ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["saving API-KEY"]}," as well."]}]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":3},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Fetch token via token endpoint"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In OAuth 2.0 approach, you must generate authentication token first."]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Use the below data in the API Client of your choice:"]}]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Environment"},"children":["Environment"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Method"},"children":["Method"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Token Endpoint"},"children":["Token Endpoint"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Production"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["POST"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["https://id.cdq.com/auth/realms/cs/protocol/openid-connect/token"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Name"},"children":["Name"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Sent as"},"children":["Sent as"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Value"},"children":["Value"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Content-Type"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Header"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["application/x-www-form-urlencoded"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Authentication"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Header"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["\"Basic \" + Base64(<",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Client Id"]},">:<",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Client Secret"]},">)"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["grant_type"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Parameter (body)"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["client_credentials"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Example using cURL:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -X POST \\ https://id.cdq.com/auth/realms/cs/protocol/openid-connect/token\n     -H \"Content-Type: application/x-www-form-urlencoded\" \\\n     -d 'grant_type=client_credentials' \\\n     -u \"<Client Id>:<Client Secret>\" \\\n\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Example using Insomnia:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Add a new ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["POST"]}," request with the token endpoint address"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["In the request body select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Form URL Encoded"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Set ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["grant_type"]}," parameter to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["client_credentials"]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/oauth20-1.9d07cb4c09fe5b3c84b1fcb3344ea156d77ade11566496976c82f6da4794520a.6fde6558.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Set authentication to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Basic Auth"]}," and provide ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Client ID"]}," as a username and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Client Secret"]}," as a password."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/oauth20-3.8e50b1b67664dd30e373f6f18e8ec1a2e6f1fa87af6b3b89342b67dc4a301801.6fde6558.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Add Header ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Content-Type"]}," with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["application/x-www-form-urlencoded"]}," value."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/oauth20-4.2093a1cd5f9f44d345b20a6278beb569bbdb725211f8682ad345e2fee2225509.6fde6558.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Hit Send"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Successful response:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"{\n\t\"access_token\": \"eyJhbG...HSmgnS_0\",\n\t\"expires_in\": 1800,\n\t\"token_type\": \"Bearer\",\n}\n"},"children":[]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info","name":"Important parameters"},"children":[{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["access_token"]}," - long string to be used in the API authentication"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["expires_in"]}," - expiration time of token in seconds"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["token_type"]}," - token type to be set in the API authentication"]}]}]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":4},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use the authentication token"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select one of many CDQ's endpoints and use the below data with the new request"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Add token to every request towards CDQ, Authentication: Bearer ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["<token>"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Example using cURL:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -X GET \\ https://api.cdq.com/requiredapi\n     -H \"Authorization: Bearer eyJhbG...HSmgnS_0\" \\\n\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Example using Insomnia:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Add a new request with the required endpoint address"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Set authentication to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Bearer"]}," and provide ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["access_token"]}," value as a token."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/oauth20-6.1e2b0e6e374a1dd6743e57dac31a6154cd54a68c60717a79555fe9da05563028.6fde6558.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Hit Send"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Successful response:"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/oauth20-7.e7457fa7d8e6a04c80c82be265fbac3299087d9b96975c8905d8d531655f50c6.6fde6558.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In the case of 403 Forbidden response check your ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["access_token"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/oauth20-8.03489c3ec3728d77fe6ca9c9ee796ac1934114d3a133b8a5cd5c58e5718cf309.6fde6558.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Make sure you copied the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["access_token"]}," value without ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["question marks"]},"."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"basic-authentication","__idx":6},"children":["Basic Authentication"]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"warning"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["CDQ doesn't recommend using Basic Authentication Header Generator for authorization anymore."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"your-opinion-matters","__idx":7},"children":["Your opinion matters!"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["We are constantly working on providing an outstanding user experience with our products. Please share your opinion about this tutorial!"]}]},"headings":[{"value":"Authentication","id":"authentication","depth":1},{"value":"Prerequisites","id":"prerequisites","depth":2},{"value":"Step 1: API Key Management","id":"step-1-api-key-management","depth":2},{"value":"Step 2: Generate the authentication details","id":"step-2-generate-the-authentication-details","depth":2},{"value":"API Key","id":"api-key","depth":3},{"value":"OAuth 2.0","id":"oauth-20","depth":3},{"value":"Basic Authentication","id":"basic-authentication","depth":2},{"value":"Your opinion matters!","id":"your-opinion-matters","depth":2}],"frontmatter":{"seo":{"title":"Authentication"}},"lastModified":"2026-05-14T08:19:51.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/documentation/_public/instructions/authentication","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}