Skip to content

Commit c15f374

Browse files
authored
Merge branch 'stage' into promTo/stage
2 parents 4828904 + 3720093 commit c15f374

4 files changed

Lines changed: 35 additions & 26 deletions

File tree

docs/.vuepress/nav/left/guides.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,6 @@ module.exports = [
5757
// '/guides/qr-acceptance',
5858
// ];
5959
// }
60+
61+
6062

61-
//

docs/.vuepress/theme/components/PageResource.vue

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -132,14 +132,7 @@
132132
"
133133
>
134134
Length: <code>{{ type.minLength }}</code>
135-
</li>
136-
<li v-else-if="type.minLength && type.maxLength">
137-
Length:
138-
<code
139-
>&#8804; {{ type.minLength }} && &#8805;
140-
{{ type.maxLength }}</code
141-
>
142-
</li>
135+
</li
143136
<li v-else-if="type.minLength">
144137
Length: <code>&#8805; {{ type.minLength }}</code>
145138
</li>

docs/api/guides/introduction/authentication.md

Lines changed: 31 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,39 @@
22
title: Authentication
33
description: Authentication
44
---
5-
65
# Authentication
76

8-
In the Settle API different authentication levels (auth levels) can be achieved depending on the authentication method being used. In the [API Reference](/api/merchant/) the required level for each endpoint in the API is given. A list is given here of the auth levels in the Settle API, ordered from lowest to highest level:
7+
In the Settle API different authentication levels ***(Auth Levels)*** can be achieved depending on the authentication method being used. In the [API Reference](/api/merchant/) the required level for each endpoint in the API is given. A list is given here of the **Auth Levels** in the Settle API, ordered from lowest to highest level:
98

10-
1. OPEN _(no authentication required)_
11-
2. [SECRET](#authentication-using-secret)
12-
3. [KEY](#authentication-using-rsa-signature)
9+
1. OPEN *(no authentication required)*
10+
2. [**JWT** *(Shared Secret)*](#authentication-using-secret)
11+
3. [**RSA** *(Private/Public Keypair)*](#authentication-using-rsa-signature)
1312

14-
When authenticated with a particular auth level, the client is also authorized for endpoints requiring a lower auth level. E.g. if authenticated with auth level [KEY](/guides/authentication/#authentication-using-rsa-signature), endpoints requiring [SECRET](/guides/authentication/#authentication-using-secret) or OPEN are also accessible.
13+
When authenticated with a particular **Auth Level**, the client is also authorized for endpoints requiring a lower authentication level. E.g. if authenticated with **Auth Level** [](/guides/authentication/#authentication-using-rsa-signature)RSA, endpoints requiring [JWT](/guides/authentication/#authentication-using-secret) or OPEN are also accessible.
1514

1615
## Required Request Headers
1716

1817
Any request to the Settle API requires the following request headers:
1918

20-
| X-Auka-Merchant: | This header should contain the Settle ID of the merchant as returned in the `id` field of the [`merchant`](https://developer.settle.eu/handlers.html#get--merchant--merchant_id-- 'GET /merchant/<merchant_id>/') endpoint. |
21-
| X-Auka-User: | The ID (username) of the user/client doing the request on behalf of the merchant. Users are created by the merchant through the Self Service Portal or by the integrator using the `user` endpoint. Each user has is an ID locally unique for the merchant and is assigned a shared secret and/or a RSA public key that is used for authentication. |
22-
| Authorization: | The value of this field depends on what kind of authentication scheme is being used. Currently the supported schemes are _SECRET_ and _RSA-SHA256_. The general form of this header is: `Authorization: <auth_scheme> <auth_data>` |
23-
| X-Auka-Integrator: | Only to be used by integrators acting as a proxy on behalf of merchant client, in which case it replaces the **X-Auka-User** header. The value of this field is the ID issued to the integrator by Settle. When this header is used only authentication using RSA signatures is allowed (not secret) and Settle will check the signature against the public key of the integrator. |
19+
#### X-Settle-Merchant
20+
21+
This header should contain the Settle ID of the merchant as returned in the `id` field of the [ `merchant.profile.get` ](/api/reference/rest/v1/merchant.profile/get/) endpoint.
22+
23+
#### X-Settle-User
24+
25+
The ID of the user/client doing the request on behalf of the Merchant. Users are created by the Merchant through the Self Service Portal or by the Integrator using the [`merchant.apiKeys.create`](/api/reference/rest/v1/merchant.apiKeys/create/) endpoint. Each **X-Settle-User** has an ID locally unique for the Merchant and is assigned a **JWT** *(Shared Secret)* and/or an **RSA** Public Key that is used for authentication.
26+
27+
#### Authorization
28+
29+
The value of this field depends on what kind of authentication scheme is being used. Currently the supported schemes are **JWT** *(Shared Secret)* and **RSA-SHA256**.
30+
31+
The general form of this header is:
32+
33+
`Authorization: <auth_scheme> <auth_data>`
34+
35+
#### X-Settle-Integrator
36+
37+
Only to be used by integrators acting as a proxy on behalf of a Merchant client, in which case it replaces the **X-Settle-User** header. The value of this field is the ID issued to the integrator by Settle. When this header is used only authentication using **RSA** signatures is allowed *(not secret)* and Settle will check the signature against the public key of the integrator.
2438

2539
::: tip NOTE
2640
When using the Settle testbed environment, an **X-Testbed-Token** header is also required. The value of this header is the testbed token you received via email when activating your testbed account. It looks like:
@@ -29,12 +43,12 @@ When using the Settle testbed environment, an **X-Testbed-Token** header is also
2943
:::
3044

3145
::: tip NOTE
32-
The **X-Auka-Integrator** header MUST NOT be used unless the merchant clients are communicating _through_ a server, controlled by the integrator, acting as a proxy. If a client is using a direct connection to Settle, even though the integrator owns the client and may control it through some other channel, it MUST use merchant user credentials and the **X-Auka-User** header.
46+
The **X-Auka-Integrator** header MUST NOT be used unless the merchant clients are communicating *through* a server, controlled by the integrator, acting as a proxy. If a client is using a direct connection to Settle, even though the integrator owns the client and may control it through some other channel, it MUST use merchant user credentials and the **X-Auka-User** header.
3347
:::
3448

35-
## Authentication using SECRET
49+
## Authentication using JWT
3650

37-
- Auth Level: SECRET
51+
* **Auth Level:** JWT
3852

3953
Authentication using a shared secret (JSON Web Token) is the simplest authentication method supported by Settle. This method requires an authorization header on the following form:
4054

@@ -56,9 +70,9 @@ Authorization: SECRET MySecretPassword
5670

5771
## Authentication using RSA signature
5872

59-
- Auth Level: KEY
73+
* **Auth Level:** RSA
6074

61-
Settle generates and validates according to the _PKCS#1 v1.5_ (RSASSA-PKCS1-v1_5) standard described in **[RFC 3447](http://tools.ietf.org/html/rfc3447.html)**. The hash function used in the signing procedure is [SHA256](https://en.wikipedia.org/wiki/SHA-2).
75+
Settle generates and validates according to the *PKCS#1 v1.5* (RSASSA-PKCS1-v1_5) standard described in **[RFC 3447](http://tools.ietf.org/html/rfc3447.html)**. The hash function used in the signing procedure is [SHA256](https://en.wikipedia.org/wiki/SHA-2).
6276

6377
### Headers
6478

@@ -70,7 +84,7 @@ The RSA authentication method requires two extra headers:
7084
7185
#### X-Auka-Content-Digest
7286

73-
> The _base64_ encoded hash digest of the request body. If the body is empty, the hash should be computed on an empty string. The value of the header should be on the form `<algorithm (uppercase)>=<digest value>`. So, if the SHA256 hashing algorithm is used on a request with empty body, the header will be: `X-Auka-Content-Digest: SHA256=47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=` Currently only the SHA256 hashing algorithm is supported.
87+
> The *base64* encoded hash digest of the request body. If the body is empty, the hash should be computed on an empty string. The value of the header should be on the form `<algorithm (uppercase)>=<digest value>`. So, if the SHA256 hashing algorithm is used on a request with empty body, the header will be: `X-Auka-Content-Digest: SHA256=47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=` Currently only the SHA256 hashing algorithm is supported.
7488
7589
For RSA authentication the authorization header looks like this:
7690

@@ -131,4 +145,4 @@ The Python script that was used for generating the signature and `X-Auka-Content
131145

132146
## Verifying signatures from Settle
133147

134-
Whenever Settle is sending callbacks to the client over HTTPS the request from Settle is signed using the same RSA method as described in the above _[section](/guides/authentication/#authentication-using-rsa-signature)_. The client should authenticate callbacks from Settle by verifying the signature given by Settle in the Authorization header of the request. The public key used by Settle in test environments can be downloaded [`here`](https://developer.settle.eu/_downloads/testserver-pub.pem). The public key for the production environment can be obtained by contacting Settle.
148+
Whenever Settle is sending callbacks to the client over HTTPS the request from Settle is signed using the same RSA method as described in the above *[section](/guides/authentication/#authentication-using-rsa-signature)*. The client should authenticate callbacks from Settle by verifying the signature given by Settle in the Authorization header of the request. The public key used by Settle in test environments can be downloaded [`here`](https://developer.settle.eu/_downloads/testserver-pub.pem). The public key for the production environment can be obtained by contacting Settle.

docs/api/reference/rest/v1/merchant.balance/get.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ schema: merchant.balance
77
operationId: merchant.balance.get
88
operation: get
99
method: get
10+
1011
authLevel: JWT
1112
authRoles: USER, SUPERUSER, INTEGRATOR
1213
---

0 commit comments

Comments
 (0)