> For the complete documentation index, see [llms.txt](https://docs.fortifiedid.se/access/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fortifiedid.se/access/key-components/authenticators/credential-validators/siths-eid/with-qr-or-app-switch.md).

# With QR or "app-switch"

This authenticator expects users either scan a QR code or "app-switch". Used for both mobile and Windows clients.

## Configuration

{% hint style="info" %}
**Authenticator type:** `SithsWithQr`
{% endhint %}

Common Authenticator configuration can be found [here](/access/key-components/authenticators/common-configuration.md).

{% tabs %}
{% tab title="Properties" %}

<table data-full-width="true"><thead><tr><th>Name</th><th>Description</th><th>Default value</th><th data-type="checkbox">Mandatory</th></tr></thead><tbody><tr><td><code>internal_http_destination</code></td><td>ID of the internal http client used to talk with SITHS eID backend.</td><td><code>"default"</code></td><td>true</td></tr><tr><td><code>custom_siths_endpoint</code></td><td>Custom SITHS eID endpoint. This value overrides the <code>mode</code> value.</td><td>N/A</td><td>false</td></tr><tr><td><code>mode</code></td><td>Three modes are possible: <code>"production"</code><em>,</em> <code>"qa"</code> or <code>"test"</code>. Depending on the mode, the URL used to talk to SITHS eID differs.</td><td><code>"production"</code></td><td>false</td></tr><tr><td><code>custom_identifier</code></td><td>When logging events, the custom_identifier lets you tag the event.</td><td>N/A</td><td>false</td></tr><tr><td><code>poll_frequency</code></td><td>How often should client poll for status updates. Default every 2 seconds.</td><td><code>2</code></td><td>false</td></tr><tr><td><code>allowed_polling_for_minutes</code></td><td>How many minutes is client allowed to keep polling.</td><td><code>2</code></td><td>false</td></tr><tr><td><code>allowed_polling_for_seconds</code></td><td>How many seconds is client allowed to keep polling.</td><td>N/A</td><td>false</td></tr><tr><td><code>organizationName</code></td><td>The organization name/identifier to be displayed in the client.</td><td>N/A</td><td>true</td></tr><tr><td><code>rfc2253Issuers</code></td><td>Specifies what issuing CA´s that the SITHS service MAY allow.</td><td><code>["CN=SITHS e-id Person ID Mobile CA v1,O=Inera AB,C=SE","CN=SITHS e-id Person ID 3 CA v1,O=Inera AB,C=SE","CN=TEST SITHS e-id Person ID Mobile CA v1,O=Inera AB,C=SE","CN=TEST SITHS e-id Person ID 3 CA v1,O=Inera AB,C=SE"]</code></td><td>false</td></tr><tr><td><code>checkRevocation</code></td><td>Indicates if the SITHS service SHALL check the revocation status of the end-user certificate and its certificate chain.</td><td><code>true</code></td><td>false</td></tr><tr><td><code>sithsEidChallenge</code></td><td>Challenge to present to the client in order for it to establish a secure connection.</td><td>N/A</td><td>false</td></tr><tr><td><code>authMessage</code></td><td>A message for the client to show to the user during the authentication process</td><td>N/A</td><td>false</td></tr><tr><td><code>animated_qr</code></td><td>If the generated QR code should be "animated".</td><td><code>true</code></td><td>false</td></tr><tr><td>webroot_dir</td><td>See common authenticator configuration</td><td>web/authenticator/siths_qr_or_appswitch</td><td>false</td></tr></tbody></table>
{% endtab %}

{% tab title="Example" %}

```json
{
	"id": "sithsqr",
	"type": "SithsWithQr",
	"config": {
		"base_path": "/test/authn",
		"internal_http_destination": "siths",
		"organizationName": "Testportalen",
		"animated_qr": true,
		"poll_frequency": 4,
		"mode": "qa"
	}
}
```

{% endtab %}
{% endtabs %}

{% hint style="warning" %}
Property *base\_path* should not contain the full path when used in conjunction with the [Selector](/access/key-components/authenticators/flow-control/selector.md), instead, the full URI will be handled by the selector. The full path will be *base\_path + / + id*.
{% endhint %}

## Logging

Apart from system logging, event logging is done when starting, completing, and failing a SITHS eID transaction.

Event ids are:

* WEB\_100020, SITHS eID authentication started
  * IDENTIFIER (user trace id)
  * SOURCE\_ADDRESS (ip address of device starting transaction)
  * CUSTOMER\_IDENTIFIER (if configured)
* WEB\_100021, SITHS eID authentication completed
  * IDENTIFIER (user trace id)
  * SOURCE\_ADDRESS (ip address of the SITHS eID device used)
  * SOURCE\_USER\_NAME (personal number)
  * CUSTOMER\_IDENTIFIER (if configured)
* WEB\_100022, SITHS eID authentication failed
  * IDENTIFIER (user trace id)
  * SOURCE\_ADDRESS (ip address of the SITHS eID device used)
  * CUSTOMER\_IDENTIFIER (if configured)
  * MESSAGE (information)
* WEB\_100023, SITHS eID authentication canceled or expired
  * IDENTIFIER (user trace id)
  * SOURCE\_ADDRESS (ip address of the SITHS eID device used)
  * CUSTOMER\_IDENTIFIER (if configured)

## Data exposed to global state

After a user completes a transaction, the authenticator is marked as done. Data from the SITHS eID authentication response is then put into the global state (exports). The data can be referenced later (in a pipe for example) by expansion:

**`{{exports.credentialInformation_issuer}}`**

* credentialInformation\_issuer
* credentialInformation\_subject
* credentialInformation\_expireAt
* revocationStatus\_credentialId
* revocationStatus\_status
* revocationStatus\_ocspResponse
* revocationStatus\_type
* userCertificate
* personalNumber
* cert\_subject
* cert\_issuer
* cert\_not\_before
* cert\_not\_after
* cert\_serial
* cert\_key\_usage
* cert\_basic\_contraints
* cert\_sign\_algorithm
* cert\_ext\_key\_usage
* cert\_pub\_key
* cert\_pub\_key\_algorithm
* cert\_pub\_key\_format
* cert\_crl\_distribution\_points
* cert\_ocsp\_locations
* cert\_ocsp\_issuers

Note that it is not guaranteed that all parameters hold value.

## API

When communicating with the backend this describes the

### General requirements

Backend communications are made using AJAX and the HTTP PUT method. Every request need a Content-Type with the value of `application/json`*.*

### Getting state

Body must conform to the example below.

```json
{
    "type": "state"
}
```

### Starting an authentication

To start authentication send AJAX request.

```json
{
    "type": "start",
    "data": {
    }
}
```

### Cancel a request

A request can be canceled at any time. This is done by sending a cancel request.

```json
{
    "type": "cancel"
}
```

### Response from server

In general, you should expect a server response with http status code 200. Anything else is to be considered an error.

Response body will be in the form of a JSON object. Typically the response looks like:

```json
{
    "status": "PENDING",
    "sithsStatus": "OUTSTANDING_TRANSACTION",
    "qrData": "<data for generating qr>",
    "pollFrequency": 2,
    "autostartToken": "<token>"
}
```

### Possible status messages

One of the following *status* codes is returned based on the current state. These statuses are of a more general type.

* ABOUT\_TO\_START
* PENDING
* COMPLETE
* ERROR

### Possible sithsStatus messages

One of the following *sithsStatus* codes is returned based on the current state. These statuses are of a more granular type.

* OUTSTANDING\_TRANSACTION
* STARTED
* USER\_CANCEL
* EXPIRED\_TRANSACTION
* INVALID\_QR\_CODE
* CERTIFICATE\_ERR
* COMPLETE\_FAILED

## Translation keys

Default translations provided:

#### English, assets/locales/en.json

```json
{
  "siths.qr_or_app_switch.personal_identity_number": "Personal identity number",
  "siths.qr_or_app_switch.start_authentication": "Start authentication",
  "siths.qr_or_app_switch.open_app": "Open SITHS eID app",
  "siths.qr_or_app_switch.open_siths_app_on_this_device": "Log in using SITHS eID on this device",
  "siths.qr_or_app_switch.show_qr_code": "Show QR code for login",
  "siths.qr_or_app_switch.start_siths_app": "Open SITHS eID app",
  "siths.qr_or_app_switch.scan_qr_code": "Open SITHS eID app and scan QR code",
  "siths.qr_or_app_switch.qr_code_scanned": "QR code scanned",
  "siths.qr_or_app_switch.app_opened": "SITHS eID app opened",
  "siths.qr_or_app_switch.verify_authentication": "Verifify identification in the SITHS eID app",
  "siths.qr_or_app_switch.authentication_verified": "Identification verified",
  "siths.qr_or_app_switch.redirecting": "Redirecting...",
  "siths.qr_or_app_switch.start_app": "Start your SITHS eID app.",
  "siths.qr_or_app_switch.cancel": "Cancel",
  "siths.qr_or_app_switch.canceling": "Canceling...",
  "siths.qr_or_app_switch.USER_CANCEL": "Unknown error. Please try again.",
  "siths.qr_or_app_switch.EXPIRED_TRANSACTION": "The SITHS eID app is not responding. Please check that the program is started and that you have internet access. Try again.",
  "siths.qr_or_app_switch.INVALID_QR_CODE": "QR code is invalid. Please try again.",
  "siths.qr_or_app_switch.CERTIFICATE_ERR": "SITHS eID certificate is too old. Verify your SITHS eID",
  "siths.qr_or_app_switch.COMPLETE_FAILED": "Identification failed. Please try again.",
  "siths.qr_or_app_switch.ERROR": "Unknown error. Please try again.",
  "siths.qr_or_app_switch.UNKNOWN": "Unknown error. Please try again.",
  "siths.qr_or_app_switch.FAILED": "Identification failed. Please try again.",
  "siths.qr_or_app_switch.API_ERROR": "Unknown error. Please try again.",
  "allow-cookies-body": "To save your language settings on this device you need to approve a language cookie.",
  "allow-cookies-button": "Approve language cookie",
  "authentication.help_text": "",
  "change_language": "",
  "request.timeout": "Request timed out. Please try again."
}

```

#### Swedish, assets/locales/sv.json

```json
{
  "siths.qr_or_app_switch.personal_identity_number": "Personnummer",
  "siths.qr_or_app_switch.start_authentication": "Starta verifiering",
  "siths.qr_or_app_switch.open_app": "Öppna SITHS eID-appen",
  "siths.qr_or_app_switch.open_siths_app_on_this_device": "Logga in med SITHS eID på den här enheten",
  "siths.qr_or_app_switch.show_qr_code": "Visa QR-kod för inloggning",
  "siths.qr_or_app_switch.start_siths_app": "Öppna SITHS eID-appen",
  "siths.qr_or_app_switch.scan_qr_code": "Öppna SITHS eID-appen och skanna QR-koden",
  "siths.qr_or_app_switch.qr_code_scanned": "QR-koden har skannats",
  "siths.qr_or_app_switch.app_opened": "SITHS eID-appen öppnad",
  "siths.qr_or_app_switch.verify_authentication": "Bekräfta i SITHS eID-appen",
  "siths.qr_or_app_switch.authentication_verified": "Bekfräftat identitet",
  "siths.qr_or_app_switch.redirecting": "Omdirigerar...",
  "siths.qr_or_app_switch.start_app": "Starta SITHS eID-appen",
  "siths.qr_or_app_switch.cancel": "Avbryt",
  "siths.qr_or_app_switch.canceling": "Avbryter...",
  "siths.qr_or_app_switch.USER_CANCEL": "Åtgärden avbruten. Försök igen",
  "siths.qr_or_app_switch.EXPIRED_TRANSACTION": "SITHS eID-appen svarar inte. Kontrollera att den är startad och att du har internetanslutning. Försök igen",
  "siths.qr_or_app_switch.INVALID_QR_CODE": "QR-koden är ogiltig. Försök igen.",
  "siths.qr_or_app_switch.CERTIFICATE_ERR": "SITHS eID-certifikatet är för gammalt. Verifiera SitSITHShs eID-installationen",
  "siths.qr_or_app_switch.COMPLETE_FAILED": "Identifiering misslyckades. Försök igen.",
  "siths.qr_or_app_switch.ERROR": "Okänt fel. Försök igen.",
  "siths.qr_or_app_switch.UNKNOWN": "Okänt fel. Försök igen.",
  "siths.qr_or_app_switch.FAILED": "Legitimeringen misslyckades. Försök igen",
  "siths.qr_or_app_switch.API_ERROR": "Okänt fel. Försök igen.",
  "allow-cookies-body": "Vill du spara dina språkinställningar på denna enhet behövs ett godkännande av  språk-cookie.",
  "allow-cookies-button": "Godkänn språk-cookie",
  "authentication.help_text": "",
  "change_language": "",
  "request.timeout": "Tidsgränsen för förfrågan har överskridits. Försök igen."
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.fortifiedid.se/access/key-components/authenticators/credential-validators/siths-eid/with-qr-or-app-switch.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
