|
223 | 223 | .addFilterBefore(new WebEidMobileAuthInitFilter("/auth/mobile/init", "/auth/mobile/login", challengeNonceGenerator, |
224 | 224 | webEidMobileProperties, webEidAuthTokenProperties), UsernamePasswordAuthenticationFilter.class) |
225 | 225 | .addFilterBefore(new WebEidChallengeNonceFilter("/auth/challenge", challengeNonceGenerator), |
226 | | - UsernamePasswordAuthenticationFilter.class) |
| 226 | + UsernamePasswordAuthenticationFilter.class); |
227 | 227 | ``` |
228 | 228 |
|
229 | 229 | Also, see general guidelines for implementing secure authentication services [here](https://github.com/SK-EID/smart-id-documentation/wiki/Secure-Implementation-Guide). |
@@ -308,7 +308,7 @@ It contains the following fields: |
308 | 308 |
|
309 | 309 | - `signature`: the base64-encoded signature of the token (see the description below), |
310 | 310 |
|
311 | | -- `format`: the type identifier and version of the token format separated by a colon character '`:`', `web-eid:1.0` as of now; the version number consists of the major and minor number separated by a dot, major version changes are incompatible with previous versions, minor version changes are backwards-compatible within the given major version, |
| 311 | +- `format`: the type identifier and version of the token format separated by a colon character '`:`', `web-eid:1.0` or `web-eid:1.1` as of now; the version number consists of the major and minor number separated by a dot, major version changes are incompatible with previous versions, minor version changes are backwards-compatible within the given major version, |
312 | 312 |
|
313 | 313 | - `appVersion`: the URL identifying the name and version of the application that issued the token; informative purpose, can be used to identify the affected application in case of faulty tokens. |
314 | 314 |
|
@@ -358,23 +358,24 @@ Allowed values are: |
358 | 358 |
|
359 | 359 | cryptoAlgorithm: "ECC", "RSA" |
360 | 360 |
|
361 | | - hashFunction: |
362 | | - "SHA-224", "SHA-256", "SHA-384", "SHA-512", |
| 361 | + hashFunction: |
| 362 | + "SHA-224", "SHA-256", "SHA-384", "SHA-512", |
363 | 363 | "SHA3-224", "SHA3-256", "SHA3-384", "SHA3-512" |
364 | 364 |
|
365 | 365 | paddingScheme: "NONE", "PKCS1.5", "PSS" |
366 | 366 |
|
367 | 367 | # Authentication token validation |
368 | 368 |
|
369 | | -The authentication token validation process consists of two stages: |
| 369 | +The authentication token validation process consists of the following stages: |
370 | 370 |
|
371 | 371 | - First, **user certificate validation**: the validator parses the token and extracts the user certificate from the *unverifiedCertificate* field. Then it checks the certificate expiration, purpose and policies. Next it checks that the certificate is signed by a trusted CA and checks the certificate status with OCSP. |
372 | 372 | - Second, **token signature validation**: the validator validates that the token signature was created using the provided user certificate by reconstructing the signed data `hash(origin)+hash(challenge)` and using the public key from the certificate to verify the signature in the `signature` field. If the signature verification succeeds, then the origin and challenge nonce have been implicitly and correctly verified without the need to implement any additional security checks. |
373 | 373 | - Additional validation for **Web eID authentication tokens (format v1.1)**: the token must contain the `unverifiedSigningCertificates` field with at least one signing certificate entry. Each entry's `supportedSignatureAlgorithms` are validated against the set of allowed cryptographic algorithms, hash functions, and padding schemes. For each signing certificate, the following checks are performed: |
374 | 374 | - The subject must match the subject of the authentication certificate, ensuring both certificates belong to the same user. |
375 | 375 | - The issuing authority must match that of the authentication certificate, verified via the Authority Key Identifier (AKI) extension. |
376 | | - - The certificate must not be expired. |
| 376 | + - The certificate must be within its validity period. |
377 | 377 | - The certificate must contain the non-repudiation key usage bit required for digital signatures. |
| 378 | + - The certificate chain must validate against the configured trusted certificate authorities. |
378 | 379 |
|
379 | 380 | The website back end must look up the challenge nonce from its local store using an identifier specific to the browser session, to guarantee that the authentication token was received from the same browser to which the corresponding challenge nonce was issued. The website back end must guarantee that the challenge nonce lifetime is limited and that its expiration is checked, and that it can be used only once by removing it from the store during validation. |
380 | 381 |
|
@@ -506,7 +507,7 @@ In the internal implementation, the Web eID authentication token format changed |
506 | 507 |
|
507 | 508 | The Web eID authentication protocol defines two token formats currently supported by this library: |
508 | 509 |
|
509 | | -- **Format v1.0** – Used in desktop Web eID authentication flows with traditional smart card readers. |
| 510 | +- **Format v1.0** – Used in desktop Web eID authentication flows with traditional smart card readers. |
510 | 511 |
|
511 | 512 | - **Format v1.1** – An extended authentication token format that allows signing certificate information to be included in the authentication response. |
512 | 513 | - `unverifiedSigningCertificates` – an array of signing certificate entries. Each entry contains: |
|
0 commit comments