{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-country-apis-catalog/product-catalog/se/authenticate/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["admonition"]},"type":"markdown"},"seo":{"title":"Token Metadata"},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"__idx":0,"id":"token-metadata"},"children":["Token Metadata"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This page explains the structure and lifecycle of JWT tokens generated by CONNECT Authenticate."]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"__idx":1,"id":"response-structure"},"children":["Response Structure"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The authentication response contains a single field:"]},{"$$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":"Field"},"children":["Field"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["token"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The JWT Bearer token - a cryptographically signed string containing authentication claims. Valid for 1 hour."]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Example Response:"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"token\": \"eyJhbGciOiJSUzI1NiIsImtpZCI6Im…hPeGE7Ak8YtKFbA\"\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"__idx":2,"id":"jwt-token-structure"},"children":["JWT Token Structure"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The JWT token is composed of three parts separated by dots (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["."]},"):"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"{header}.{payload}.{signature}\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Header"]}," - Contains metadata about the token type and signing algorithm"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Payload"]}," - Contains the claims (user information, scopes, expiration, etc.)"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Signature"]}," - Cryptographic signature ensuring token integrity"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Example JWT token structure:"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"eyJhbGciOiJSUzI1NiIsImtpZCI6IkQ3RTRBNzMxRjMyQjYwQzM4QTQxMkREMUVCNEJBOTg4IiwidHlwIjoiYXQrand0In0\n.\neyJpc3MiOiJodHRwczovL3NlLXdlYnNlcnZpY2UuYXBwcy5jcmVkaXRzYWZlLmNvbS8iLCJuYmYiOjE3MzA5NzMyNzksImlhdCI6MTczMDk3MzI3OSwiZXhwIjoxNzMwOTc2ODc5LCJhdWQiOiJDcmVkaXRzYWZlU3dlZGlzaEFQSSIsInNjb3BlIjpbImRhdGFjaGVjayIsImNvbXBhbnlnZXRkYXRhIl0sImNsaWVudF9pZCI6InlvdXItdXNlcm5hbWUiLCJqdGkiOiI4RTdBNDk2QTZFQkZCQzQ2OTY0QzRDQTgyMzM3QkU5NiJ9\n.\nsignature_hash\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"warning","name":"Token Handling"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["While JWT tokens can be decoded to inspect their payload, you should ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["never"]}," attempt to manually verify or modify tokens. Always treat tokens as opaque strings and rely on Creditsafe's services to validate them."]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"__idx":3,"id":"token-lifecycle"},"children":["Token Lifecycle"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Understanding the token lifecycle is critical for proper implementation:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Validity Period:"]}," 1 hour from generation"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Concurrent Tokens:"]}," Multiple valid tokens can exist simultaneously"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Cross-Service Usage:"]}," Same token works for all Sweden REST APIs"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Expiration Handling:"]}," Service calls return 403 when token expires"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"__idx":4,"id":"token-lifecycle-diagram"},"children":["Token Lifecycle Diagram"]},{"$$mdtype":"Tag","name":"Mermaid","attributes":{"data-language":"mermaid","diagramSource":"flowchart TD\n    A[POST /v1/authenticate] --> B[Token Generated]\n    B --> C[Token Valid for 1 Hour]\n    C --> D{Token Status?}\n    D -->|Valid| E[Use in API Calls]\n    D -->|Expired| F[403 Token Expired]\n    F --> A\n    E --> G[Service Returns Response]\n    G --> D\n","diagramHtml":"<div class=\"mermaid\" data-processed=\"true\"><svg id=\"mermaid-1772204155153\" width=\"100%\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" class=\"flowchart\" style=\"max-width: 472.2969970703125px;\" viewBox=\"0 0 472.2969970703125 717.21875\" role=\"graphics-document document\" aria-roledescription=\"flowchart-v2\"><style>#mermaid-1772204155153{font-family:\"trebuchet ms\",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-1772204155153 .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-1772204155153 .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-1772204155153 .error-icon{fill:#552222;}#mermaid-1772204155153 .error-text{fill:#552222;stroke:#552222;}#mermaid-1772204155153 .edge-thickness-normal{stroke-width:1px;}#mermaid-1772204155153 .edge-thickness-thick{stroke-width:3.5px;}#mermaid-1772204155153 .edge-pattern-solid{stroke-dasharray:0;}#mermaid-1772204155153 .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-1772204155153 .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-1772204155153 .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-1772204155153 .marker{fill:#333333;stroke:#333333;}#mermaid-1772204155153 .marker.cross{stroke:#333333;}#mermaid-1772204155153 svg{font-family:\"trebuchet ms\",verdana,arial,sans-serif;font-size:16px;}#mermaid-1772204155153 p{margin:0;}#mermaid-1772204155153 .label{font-family:\"trebuchet ms\",verdana,arial,sans-serif;color:#333;}#mermaid-1772204155153 .cluster-label text{fill:#333;}#mermaid-1772204155153 .cluster-label span{color:#333;}#mermaid-1772204155153 .cluster-label span p{background-color:transparent;}#mermaid-1772204155153 .label text,#mermaid-1772204155153 span{fill:#333;color:#333;}#mermaid-1772204155153 .node rect,#mermaid-1772204155153 .node circle,#mermaid-1772204155153 .node ellipse,#mermaid-1772204155153 .node polygon,#mermaid-1772204155153 .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-1772204155153 .rough-node .label text,#mermaid-1772204155153 .node .label text,#mermaid-1772204155153 .image-shape .label,#mermaid-1772204155153 .icon-shape .label{text-anchor:middle;}#mermaid-1772204155153 .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-1772204155153 .rough-node .label,#mermaid-1772204155153 .node .label,#mermaid-1772204155153 .image-shape .label,#mermaid-1772204155153 .icon-shape .label{text-align:center;}#mermaid-1772204155153 .node.clickable{cursor:pointer;}#mermaid-1772204155153 .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-1772204155153 .arrowheadPath{fill:#333333;}#mermaid-1772204155153 .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-1772204155153 .flowchart-link{stroke:#333333;fill:none;}#mermaid-1772204155153 .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-1772204155153 .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-1772204155153 .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-1772204155153 .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-1772204155153 .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-1772204155153 .cluster text{fill:#333;}#mermaid-1772204155153 .cluster span{color:#333;}#mermaid-1772204155153 div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\"trebuchet ms\",verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-1772204155153 .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-1772204155153 rect.text{fill:none;stroke-width:0;}#mermaid-1772204155153 .icon-shape,#mermaid-1772204155153 .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-1772204155153 .icon-shape p,#mermaid-1772204155153 .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-1772204155153 .icon-shape rect,#mermaid-1772204155153 .image-shape rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-1772204155153 .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-1772204155153 .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-1772204155153 :root{--mermaid-font-family:\"trebuchet ms\",verdana,arial,sans-serif;}</style><g><marker id=\"mermaid-1772204155153_flowchart-v2-pointEnd\" class=\"marker flowchart-v2\" viewBox=\"0 0 10 10\" refX=\"5\" refY=\"5\" markerUnits=\"userSpaceOnUse\" markerWidth=\"8\" markerHeight=\"8\" orient=\"auto\"><path d=\"M 0 0 L 10 5 L 0 10 z\" class=\"arrowMarkerPath\" style=\"stroke-width: 1; stroke-dasharray: 1, 0;\"></path></marker><marker id=\"mermaid-1772204155153_flowchart-v2-pointStart\" class=\"marker flowchart-v2\" viewBox=\"0 0 10 10\" refX=\"4.5\" refY=\"5\" markerUnits=\"userSpaceOnUse\" markerWidth=\"8\" markerHeight=\"8\" orient=\"auto\"><path d=\"M 0 5 L 10 10 L 10 0 z\" class=\"arrowMarkerPath\" style=\"stroke-width: 1; stroke-dasharray: 1, 0;\"></path></marker><marker id=\"mermaid-1772204155153_flowchart-v2-circleEnd\" class=\"marker flowchart-v2\" viewBox=\"0 0 10 10\" refX=\"11\" refY=\"5\" markerUnits=\"userSpaceOnUse\" markerWidth=\"11\" markerHeight=\"11\" orient=\"auto\"><circle cx=\"5\" cy=\"5\" r=\"5\" class=\"arrowMarkerPath\" style=\"stroke-width: 1; stroke-dasharray: 1, 0;\"></circle></marker><marker id=\"mermaid-1772204155153_flowchart-v2-circleStart\" class=\"marker flowchart-v2\" viewBox=\"0 0 10 10\" refX=\"-1\" refY=\"5\" markerUnits=\"userSpaceOnUse\" markerWidth=\"11\" markerHeight=\"11\" orient=\"auto\"><circle cx=\"5\" cy=\"5\" r=\"5\" class=\"arrowMarkerPath\" style=\"stroke-width: 1; stroke-dasharray: 1, 0;\"></circle></marker><marker id=\"mermaid-1772204155153_flowchart-v2-crossEnd\" class=\"marker cross flowchart-v2\" viewBox=\"0 0 11 11\" refX=\"12\" refY=\"5.2\" markerUnits=\"userSpaceOnUse\" markerWidth=\"11\" markerHeight=\"11\" orient=\"auto\"><path d=\"M 1,1 l 9,9 M 10,1 l -9,9\" class=\"arrowMarkerPath\" style=\"stroke-width: 2; stroke-dasharray: 1, 0;\"></path></marker><marker id=\"mermaid-1772204155153_flowchart-v2-crossStart\" class=\"marker cross flowchart-v2\" viewBox=\"0 0 11 11\" refX=\"-1\" refY=\"5.2\" markerUnits=\"userSpaceOnUse\" markerWidth=\"11\" markerHeight=\"11\" orient=\"auto\"><path d=\"M 1,1 l 9,9 M 10,1 l -9,9\" class=\"arrowMarkerPath\" style=\"stroke-width: 2; stroke-dasharray: 1, 0;\"></path></marker><g class=\"root\"><g class=\"clusters\"></g><g class=\"edgePaths\"><path d=\"M242.486,62L228.921,66.167C215.356,70.333,188.225,78.667,174.659,86.333C161.094,94,161.094,101,161.094,104.5L161.094,108\" id=\"L_A_B_0\" class=\"edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link\" style=\";\" data-edge=\"true\" data-et=\"edge\" data-id=\"L_A_B_0\" data-points=\"W3sieCI6MjQyLjQ4NjQ3ODM2NTM4NDYsInkiOjYyfSx7IngiOjE2MS4wOTM3NSwieSI6ODd9LHsieCI6MTYxLjA5Mzc1LCJ5IjoxMTJ9XQ==\" marker-end=\"url(#mermaid-1772204155153_flowchart-v2-pointEnd)\"></path><path d=\"M161.094,166L161.094,170.167C161.094,174.333,161.094,182.667,161.094,190.333C161.094,198,161.094,205,161.094,208.5L161.094,212\" id=\"L_B_C_0\" class=\"edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link\" style=\";\" data-edge=\"true\" data-et=\"edge\" data-id=\"L_B_C_0\" data-points=\"W3sieCI6MTYxLjA5Mzc1LCJ5IjoxNjZ9LHsieCI6MTYxLjA5Mzc1LCJ5IjoxOTF9LHsieCI6MTYxLjA5Mzc1LCJ5IjoyMTZ9XQ==\" marker-end=\"url(#mermaid-1772204155153_flowchart-v2-pointEnd)\"></path><path d=\"M161.094,270L161.094,274.167C161.094,278.333,161.094,286.667,161.094,294.333C161.094,302,161.094,309,161.094,312.5L161.094,316\" id=\"L_C_D_0\" class=\"edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link\" style=\";\" data-edge=\"true\" data-et=\"edge\" data-id=\"L_C_D_0\" data-points=\"W3sieCI6MTYxLjA5Mzc1LCJ5IjoyNzB9LHsieCI6MTYxLjA5Mzc1LCJ5IjoyOTV9LHsieCI6MTYxLjA5Mzc1LCJ5IjozMjB9XQ==\" marker-end=\"url(#mermaid-1772204155153_flowchart-v2-pointEnd)\"></path><path d=\"M132.429,448.554L126.148,459.498C119.867,470.442,107.304,492.331,101.023,508.775C94.742,525.219,94.742,536.219,94.742,541.719L94.742,547.219\" id=\"L_D_E_0\" class=\"edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link\" style=\";\" data-edge=\"true\" data-et=\"edge\" data-id=\"L_D_E_0\" data-points=\"W3sieCI6MTMyLjQyOTA1NDU0MzYwMDUzLCJ5Ijo0NDguNTU0MDU0NTQzNjAwNTZ9LHsieCI6OTQuNzQyMTg3NSwieSI6NTE0LjIxODc1fSx7IngiOjk0Ljc0MjE4NzUsInkiOjU1MS4yMTg3NX1d\" marker-end=\"url(#mermaid-1772204155153_flowchart-v2-pointEnd)\"></path><path d=\"M194.322,443.991L202.892,455.695C211.462,467.4,228.602,490.809,244.797,508.279C260.991,525.748,276.24,537.277,283.864,543.042L291.489,548.806\" id=\"L_D_F_0\" class=\"edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link\" style=\";\" data-edge=\"true\" data-et=\"edge\" data-id=\"L_D_F_0\" data-points=\"W3sieCI6MTk0LjMyMTcyMDkwMTc2NzI2LCJ5Ijo0NDMuOTkwNzc5MDk4MjMyNzR9LHsieCI6MjQ1Ljc0MjE4NzUsInkiOjUxNC4yMTg3NX0seyJ4IjoyOTQuNjc5NTY1NDI5Njg3NSwieSI6NTUxLjIxODc1fV0=\" marker-end=\"url(#mermaid-1772204155153_flowchart-v2-pointEnd)\"></path><path d=\"M354.418,551.219L359.905,545.052C365.393,538.885,376.368,526.552,381.856,501.117C387.344,475.682,387.344,437.146,387.344,400.609C387.344,364.073,387.344,329.536,387.344,303.602C387.344,277.667,387.344,260.333,387.344,243C387.344,225.667,387.344,208.333,387.344,191C387.344,173.667,387.344,156.333,387.344,139C387.344,121.667,387.344,104.333,383.273,91.95C379.201,79.566,371.059,72.131,366.988,68.414L362.916,64.697\" id=\"L_F_A_0\" class=\"edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link\" style=\";\" data-edge=\"true\" data-et=\"edge\" data-id=\"L_F_A_0\" data-points=\"W3sieCI6MzU0LjQxNzcyNDYwOTM3NSwieSI6NTUxLjIxODc1fSx7IngiOjM4Ny4zNDM3NSwieSI6NTE0LjIxODc1fSx7IngiOjM4Ny4zNDM3NSwieSI6Mzk4LjYwOTM3NX0seyJ4IjozODcuMzQzNzUsInkiOjI5NX0seyJ4IjozODcuMzQzNzUsInkiOjI0M30seyJ4IjozODcuMzQzNzUsInkiOjE5MX0seyJ4IjozODcuMzQzNzUsInkiOjEzOX0seyJ4IjozODcuMzQzNzUsInkiOjg3fSx7IngiOjM1OS45NjI0Mzk5MDM4NDYxMywieSI6NjJ9XQ==\" marker-end=\"url(#mermaid-1772204155153_flowchart-v2-pointEnd)\"></path><path d=\"M94.742,605.219L94.742,609.385C94.742,613.552,94.742,621.885,108.906,630.038C123.07,638.191,151.399,646.163,165.563,650.149L179.727,654.135\" id=\"L_E_G_0\" class=\"edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link\" style=\";\" data-edge=\"true\" data-et=\"edge\" data-id=\"L_E_G_0\" data-points=\"W3sieCI6OTQuNzQyMTg3NSwieSI6NjA1LjIxODc1fSx7IngiOjk0Ljc0MjE4NzUsInkiOjYzMC4yMTg3NX0seyJ4IjoxODMuNTc3NDQ4OTE4MjY5MjMsInkiOjY1NS4yMTg3NX1d\" marker-end=\"url(#mermaid-1772204155153_flowchart-v2-pointEnd)\"></path><path d=\"M375.462,655.219L390.267,651.052C405.073,646.885,434.685,638.552,449.491,625.719C464.297,612.885,464.297,595.552,464.297,576.219C464.297,556.885,464.297,535.552,423.871,509.471C383.445,483.39,302.593,452.562,262.167,437.148L221.741,421.734\" id=\"L_G_D_0\" class=\"edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link\" style=\";\" data-edge=\"true\" data-et=\"edge\" data-id=\"L_G_D_0\" data-points=\"W3sieCI6Mzc1LjQ2MTYxMzU4MTczMDgsInkiOjY1NS4yMTg3NX0seyJ4Ijo0NjQuMjk2ODc1LCJ5Ijo2MzAuMjE4NzV9LHsieCI6NDY0LjI5Njg3NSwieSI6NTc4LjIxODc1fSx7IngiOjQ2NC4yOTY4NzUsInkiOjUxNC4yMTg3NX0seyJ4IjoyMTguMDAzNzIzMjA4Mjg5OCwieSI6NDIwLjMwODc3Njc5MTcxMDJ9XQ==\" marker-end=\"url(#mermaid-1772204155153_flowchart-v2-pointEnd)\"></path></g><g class=\"edgeLabels\"><g class=\"edgeLabel\"><g class=\"label\" data-id=\"L_A_B_0\" transform=\"translate(0, 0)\"><foreignObject width=\"0\" height=\"0\"><div xmlns=\"http://www.w3.org/1999/xhtml\" class=\"labelBkg\" style=\"display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;\"><span class=\"edgeLabel\"></span></div></foreignObject></g></g><g class=\"edgeLabel\"><g class=\"label\" data-id=\"L_B_C_0\" transform=\"translate(0, 0)\"><foreignObject width=\"0\" height=\"0\"><div xmlns=\"http://www.w3.org/1999/xhtml\" class=\"labelBkg\" style=\"display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;\"><span class=\"edgeLabel\"></span></div></foreignObject></g></g><g class=\"edgeLabel\"><g class=\"label\" data-id=\"L_C_D_0\" transform=\"translate(0, 0)\"><foreignObject width=\"0\" height=\"0\"><div xmlns=\"http://www.w3.org/1999/xhtml\" class=\"labelBkg\" style=\"display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;\"><span class=\"edgeLabel\"></span></div></foreignObject></g></g><g class=\"edgeLabel\" transform=\"translate(94.7421875, 514.21875)\"><g class=\"label\" data-id=\"L_D_E_0\" transform=\"translate(-18.1484375, -12)\"><foreignObject width=\"36.296875\" height=\"24\"><div xmlns=\"http://www.w3.org/1999/xhtml\" class=\"labelBkg\" style=\"display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;\"><span class=\"edgeLabel\"><p>Valid</p></span></div></foreignObject></g></g><g class=\"edgeLabel\" transform=\"translate(238.15379, 503.85483)\"><g class=\"label\" data-id=\"L_D_F_0\" transform=\"translate(-28.203125, -12)\"><foreignObject width=\"56.40625\" height=\"24\"><div xmlns=\"http://www.w3.org/1999/xhtml\" class=\"labelBkg\" style=\"display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;\"><span class=\"edgeLabel\"><p>Expired</p></span></div></foreignObject></g></g><g class=\"edgeLabel\"><g class=\"label\" data-id=\"L_F_A_0\" transform=\"translate(0, 0)\"><foreignObject width=\"0\" height=\"0\"><div xmlns=\"http://www.w3.org/1999/xhtml\" class=\"labelBkg\" style=\"display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;\"><span class=\"edgeLabel\"></span></div></foreignObject></g></g><g class=\"edgeLabel\"><g class=\"label\" data-id=\"L_E_G_0\" transform=\"translate(0, 0)\"><foreignObject width=\"0\" height=\"0\"><div xmlns=\"http://www.w3.org/1999/xhtml\" class=\"labelBkg\" style=\"display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;\"><span class=\"edgeLabel\"></span></div></foreignObject></g></g><g class=\"edgeLabel\"><g class=\"label\" data-id=\"L_G_D_0\" transform=\"translate(0, 0)\"><foreignObject width=\"0\" height=\"0\"><div xmlns=\"http://www.w3.org/1999/xhtml\" class=\"labelBkg\" style=\"display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;\"><span class=\"edgeLabel\"></span></div></foreignObject></g></g></g><g class=\"nodes\"><g class=\"node default\" id=\"flowchart-A-0\" transform=\"translate(330.390625, 35)\"><rect class=\"basic label-container\" style=\"\" x=\"-113.34375\" y=\"-27\" width=\"226.6875\" height=\"54\"></rect><g class=\"label\" style=\"\" transform=\"translate(-83.34375, -12)\"><rect></rect><foreignObject width=\"166.6875\" height=\"24\"><div xmlns=\"http://www.w3.org/1999/xhtml\" style=\"display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;\"><span class=\"nodeLabel\"><p>POST /v1/authenticate</p></span></div></foreignObject></g></g><g class=\"node default\" id=\"flowchart-B-1\" transform=\"translate(161.09375, 139)\"><rect class=\"basic label-container\" style=\"\" x=\"-94.5625\" y=\"-27\" width=\"189.125\" height=\"54\"></rect><g class=\"label\" style=\"\" transform=\"translate(-64.5625, -12)\"><rect></rect><foreignObject width=\"129.125\" height=\"24\"><div xmlns=\"http://www.w3.org/1999/xhtml\" style=\"display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;\"><span class=\"nodeLabel\"><p>Token Generated</p></span></div></foreignObject></g></g><g class=\"node default\" id=\"flowchart-C-3\" transform=\"translate(161.09375, 243)\"><rect class=\"basic label-container\" style=\"\" x=\"-113.515625\" y=\"-27\" width=\"227.03125\" height=\"54\"></rect><g class=\"label\" style=\"\" transform=\"translate(-83.515625, -12)\"><rect></rect><foreignObject width=\"167.03125\" height=\"24\"><div xmlns=\"http://www.w3.org/1999/xhtml\" style=\"display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;\"><span class=\"nodeLabel\"><p>Token Valid for 1 Hour</p></span></div></foreignObject></g></g><g class=\"node default\" id=\"flowchart-D-5\" transform=\"translate(161.09375, 398.609375)\"><polygon points=\"78.609375,0 157.21875,-78.609375 78.609375,-157.21875 0,-78.609375\" class=\"label-container\" transform=\"translate(-78.109375, 78.609375)\"></polygon><g class=\"label\" style=\"\" transform=\"translate(-51.609375, -12)\"><rect></rect><foreignObject width=\"103.21875\" height=\"24\"><div xmlns=\"http://www.w3.org/1999/xhtml\" style=\"display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;\"><span class=\"nodeLabel\"><p>Token Status?</p></span></div></foreignObject></g></g><g class=\"node default\" id=\"flowchart-E-7\" transform=\"translate(94.7421875, 578.21875)\"><rect class=\"basic label-container\" style=\"\" x=\"-86.7421875\" y=\"-27\" width=\"173.484375\" height=\"54\"></rect><g class=\"label\" style=\"\" transform=\"translate(-56.7421875, -12)\"><rect></rect><foreignObject width=\"113.484375\" height=\"24\"><div xmlns=\"http://www.w3.org/1999/xhtml\" style=\"display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;\"><span class=\"nodeLabel\"><p>Use in API Calls</p></span></div></foreignObject></g></g><g class=\"node default\" id=\"flowchart-F-9\" transform=\"translate(330.390625, 578.21875)\"><rect class=\"basic label-container\" style=\"\" x=\"-98.90625\" y=\"-27\" width=\"197.8125\" height=\"54\"></rect><g class=\"label\" style=\"\" transform=\"translate(-68.90625, -12)\"><rect></rect><foreignObject width=\"137.8125\" height=\"24\"><div xmlns=\"http://www.w3.org/1999/xhtml\" style=\"display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;\"><span class=\"nodeLabel\"><p>403 Token Expired</p></span></div></foreignObject></g></g><g class=\"node default\" id=\"flowchart-G-13\" transform=\"translate(279.51953125, 682.21875)\"><rect class=\"basic label-container\" style=\"\" x=\"-125.984375\" y=\"-27\" width=\"251.96875\" height=\"54\"></rect><g class=\"label\" style=\"\" transform=\"translate(-95.984375, -12)\"><rect></rect><foreignObject width=\"191.96875\" height=\"24\"><div xmlns=\"http://www.w3.org/1999/xhtml\" style=\"display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;\"><span class=\"nodeLabel\"><p>Service Returns Response</p></span></div></foreignObject></g></g></g></g></g></svg></div>"},"children":["flowchart TD\n    A[POST /v1/authenticate] --> B[Token Generated]\n    B --> C[Token Valid for 1 Hour]\n    C --> D{Token Status?}\n    D -->|Valid| E[Use in API Calls]\n    D -->|Expired| F[403 Token Expired]\n    F --> A\n    E --> G[Service Returns Response]\n    G --> D\n"]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"em","attributes":{},"children":["Diagram summary (accessibility): A token is generated via POST to the authenticate endpoint. It remains valid for one hour. On each use, if the token is still valid it is used in API calls and the service returns a response; if the token has expired, a 403 error is returned and a new token must be requested."]}]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"__idx":5,"id":"token-refresh-best-practices"},"children":["Token Refresh Best Practices"]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"success","name":"Recommended Approach"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Proactive Refresh Strategy:"]}]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Track when the token was generated"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Set a refresh timer for ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["55 minutes"]}," after generation"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Request a new token before the current one expires"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["This ensures uninterrupted service access"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Generating new tokens too frequently (e.g., every few minutes) can degrade performance."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Alternative Approach:"]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Catch 403 Token Expired responses"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Refresh the token reactively"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Retry the failed request with the new token"]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"__idx":6,"id":"cross-api-token-usage"},"children":["Cross-API Token Usage"]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info","name":"One Token for All Services"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The same authentication token can be used across ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["all"]}," Creditsafe Sweden REST APIs:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["GetDataUnits REST"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["DateCheck Consumer REST"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["DateCheck Company REST"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["GetSignatory v2 REST"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["GetData REST"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["SPAR Consumer search v2 REST"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You do ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["not"]}," need to authenticate separately for each API."]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"__idx":7,"id":"security-considerations"},"children":["Security Considerations"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Token Storage:"]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Store tokens securely in memory or secure storage"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Never log tokens in plain text"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Never commit tokens to version control"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Use environment variables or secure vaults for credential management"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Token Transmission:"]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Always use HTTPS when transmitting tokens"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Include tokens only in the Authorization header"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Never pass tokens in URL parameters or query strings"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Token Rotation:"]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Implement automatic token refresh before expiration"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Invalidate old tokens once new ones are acquired (optional)"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Monitor for authentication failures and implement retry logic"]}]}]},"headings":[{"value":"Token Metadata","id":"token-metadata","depth":1},{"value":"Response Structure","id":"response-structure","depth":2},{"value":"JWT Token Structure","id":"jwt-token-structure","depth":2},{"value":"Token Lifecycle","id":"token-lifecycle","depth":2},{"value":"Token Lifecycle Diagram","id":"token-lifecycle-diagram","depth":3},{"value":"Token Refresh Best Practices","id":"token-refresh-best-practices","depth":2},{"value":"Cross-API Token Usage","id":"cross-api-token-usage","depth":2},{"value":"Security Considerations","id":"security-considerations","depth":2}],"frontmatter":{"seo":{"title":"Token Metadata"}},"lastModified":"2026-04-28T11:14:53.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/country-apis-catalog/product-catalog/se/authenticate/documentation/metadata","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}