{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-products/esp/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["admonition"]},"type":"markdown"},"seo":{"title":"Get user token","description":"Integration and usage documentation.","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":"get-user-token","__idx":0},"children":["Get user token"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["After the user authenticates with the identity provider, ESP redirects to the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["final"]}," URL with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sessionid"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sessionkey"]}," query parameters. Use this endpoint to exchange those parameters for a JWT containing the user's identity attributes."]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"warning","name":"Deprecated endpoint"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The previous endpoint ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/sslprotected/environment_name/getUser"]}," is deprecated. Use the endpoint below instead."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For the full technical reference, see the ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"/products/esp/openapi/get-user"},"children":["OpenAPI specification"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"endpoint","__idx":1},"children":["Endpoint"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"GET /api/secure/{environment_name}/getUser\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"headers","__idx":2},"children":["Headers"]},{"$$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":"Required"},"children":["Required"]},{"$$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":"code","attributes":{},"children":["Esp-Api-Key"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Yes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["API key for the environment."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"path-parameters","__idx":3},"children":["Path parameters"]},{"$$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":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Required"},"children":["Required"]},{"$$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":"code","attributes":{},"children":["environment_name"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Yes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The environment path provided by Namirial during the assessment phase (e.g. ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["myintegration"]},")"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"query-parameters","__idx":4},"children":["Query parameters"]},{"$$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":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Required"},"children":["Required"]},{"$$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":"code","attributes":{},"children":["sessionid"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Yes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The user identifier returned as a query parameter in the redirect to the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["final"]}," URL after login"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sessionkey"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Yes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The session key returned as a query parameter in the redirect to the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["final"]}," URL after login"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"request-example","__idx":5},"children":["Request example"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"GET /api/secure/myintegration/getUser?sessionid=<sessionid>&sessionkey=<sessionkey>\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"response-examples","__idx":6},"children":["Response examples"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The endpoint returns a signed ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"https://jwt.io/introduction"},"children":["JWT"]}," containing the user's identity attributes. You can inspect the token content using the ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"https://jwt.io/#debugger-io"},"children":["JWT debugger"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["200 — SPID JWT payload example"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"dateOfBirth\": \"1980-01-01\",\n  \"domicileMunicipality\": \"ANCONA\",\n  \"domicileNation\": \"IT\",\n  \"placeOfBirth\": \"A271\",\n  \"expirationDate\": \"2030-09-10\",\n  \"domicileStreetAddress\": \"via sample, 11\",\n  \"familyName\": \"ROSSI\",\n  \"mobilePhone\": \"00390000000000\",\n  \"address\": \"via sample, 11 60120 ANCONA AN\",\n  \"email\": \"m.rossi@example.com\",\n  \"domicilePostalCode\": \"60120\",\n  \"name\": \"MARIO\",\n  \"countyOfBirth\": \"AN\",\n  \"spidCode\": \"NAMI0000000000\",\n  \"gender\": \"M\",\n  \"fiscalNumber\": \"TINIT-RSSMRA80A01A271B\",\n  \"domicileProvince\": \"AN\",\n  \"digitalAddress\": \"\",\n  \"idCard\": \"\",\n  \"level\": null,\n  \"reqId\": \"_e709d704aa3b47eda307203119a987ac\",\n  \"assertionId\": \"_71ce2354dd3222a0db8477dcb1441fec\"\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["200 — CIE JWT payload example"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"dateOfBirth\": \"1980-01-01\",\n  \"familyName\": \"ROSSI\",\n  \"name\": \"MARIO\",\n  \"fiscalNumber\": \"TINIT-RSSMRA80A01A271B\",\n  \"reqId\": \"_e709d704aa3b47eda307203119a987ac\",\n  \"assertionId\": \"_71ce2354dd3222a0db8477dcb1441fec\"\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"error-codes","__idx":7},"children":["Error codes"]},{"$$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":"HTTP Status"},"children":["HTTP Status"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Error code"},"children":["Error code"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Error type"},"children":["Error type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Solution"},"children":["Solution"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["400"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["—"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Bad request"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sessionid"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sessionkey"]}," parameter is missing or the session was not found"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["401"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["—"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Unauthorized"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The API key is missing. Include the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Esp-Api-Key"]}," header"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["403"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["—"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Forbidden"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The API key is invalid or does not have access to this environment"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["404"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["—"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Not found"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["environment_name"]}," does not exist"]}]}]}]}]}]},"headings":[{"value":"Get user token","id":"get-user-token","depth":1},{"value":"Endpoint","id":"endpoint","depth":4},{"value":"Headers","id":"headers","depth":4},{"value":"Path parameters","id":"path-parameters","depth":4},{"value":"Query parameters","id":"query-parameters","depth":4},{"value":"Request example","id":"request-example","depth":4},{"value":"Response examples","id":"response-examples","depth":4},{"value":"Error codes","id":"error-codes","depth":4}],"frontmatter":{"seo":{"title":"Get user token"}},"lastModified":"2026-03-07T14:10:45.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/products/esp/enterprise-documentation/developer-documentation/integration-guide/token","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}