Various tools used for testing Altinn
Simple HTTP API for generating arbitrary enterprise and person access tokens for test environments, used for automated testing. Matches tokens produced by Altinn3 token exchange or consent-token endpoints. Implemented as a Azure Function running at https://altinn-testtools-token-generator.azurewebsites.net.
The application requires authentication. See https://altinn.github.io/docs/api/rest/kom-i-gang/tokengenerator/ for more information.
{environment} is an Altinn test environment name eg. at24 og tt02
https://altinn-testtools-token-generator.azurewebsites.net/api/GetEnterpriseToken?env={environment}&scopes={scopes}&org={orgName}&orgNo={orgNo}
https://altinn-testtools-token-generator.azurewebsites.net/api/GetPersonalToken?env={environment}&scopes={scopes}&userId={userId}&partyId={partyId}&pid={pid}
Systemuser tokens (see docs)
https://altinn-testtools-token-generator.azurewebsites.net/api/GetSystemUserToken?env={environment}&scopes={scopes}&systemUserId={systemUserId}&systemUserOrg={systemUserOrg}&clientId={clientId}
https://altinn-testtools-token-generator.azurewebsites.net/api/GetEnterpriseUserToken?env={environment}&orgNo={orgNo}&partyId={partyId}&userId={userId}&userName={userName}
supplierOrgNo(Enterprise tokens only)ttl(Default: 1800 seconds)authLvl(Personal tokens only. Default:3)consumerOrgNo(Personal tokens only. Default:991825827)userName(Personal tokens only. Default: empty string)clientAmr(Personal tokens only. Default:virksomhetssertifikat)dump(displays a human readable decoded JWT)
https://altinn-testtools-token-generator.azurewebsites.net/api/GetConsentToken?env={environment}&serviceCodes={serviceCodes}&offeredBy={offeredBy}&coveredBy={coveredBy}
serviceCodesis a delimited list of{servicesCode}_{serviceEditionCode}.{servicesCode2}_{serviceEditionCode2}, eg.5120_1.5678_2offeredBy,coveredByandhandledBy(optional) is a 9 or 11 long all-digit string.authorizationCodeis av valid GUID. If omitted a random one is used.ttl(optional) is the valid lifetime of the token in seconds. Default: 30 seconds.
Consent service metadata (parameters) are supplied the same way as in URL-based consent requests, eg. ..&5120_1_myparam=myvalue.
Simple console app for calling the API from a shell script. Uses appsettings.json for default settings, all of which can be overridden by command line arguments.
Build, and run TokenGeneratorCli.exe --help