You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## 6. Add a REST endpoint for issuing challenge nonces
137
+
## 6. Add a filter for issuing challenge nonces
138
138
139
-
A REST endpoint that issues challenge nonces is required for authentication. The endpoint must support `GET` requests.
139
+
A REST endpoint that issues challenge nonces is required for authentication.
140
+
Since this step is part of the authentication flow, it is implemented as a Spring Security filter instead of a regular controller. The filter must support `POST` requests.
140
141
141
-
In the following example, we are using the [Spring RESTful Web Services framework](https://spring.io/guides/gs/rest-service/) to implement the endpoint, see also the full implementation [here](example/blob/main/src/main/java/eu/webeid/example/web/rest/ChallengeController.java).
142
+
The `WebEidChallengeNonceFilter` handles `/auth/challenge` requests and issues a new nonce.
143
+
See the full implementation [here](example/src/main/java/eu/webeid/example/security/WebEidChallengeNonceFilter.java).
Also, see general guidelines for implementing secure authentication services [here](https://github.com/SK-EID/smart-id-documentation/wiki/Secure-Implementation-Guide).
Copy file name to clipboardExpand all lines: example/README.md
+6-5Lines changed: 6 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -114,12 +114,13 @@ The source code folder `src` contains the application source code and resources
114
114
The `src/main/java/eu/webeid/example` directory contains the Spring Boot application Java class and the following subdirectories:
115
115
116
116
- `config`: Spring and HTTP security configuration, Web eID authentication token validation library configuration, trusted CA certificates loading etc,
117
-
- `security`: Web eID authentication token validation library integration with Spring Security via an `AuthenticationProvider` and `AuthenticationProcessingFilter`,
117
+
- `security`: Web eID authentication token validation library integration with Spring Security
118
+
- `AuthenticationProvider`and `AuthenticationProcessingFilter` for handling Web eID authentication tokens,
119
+
- `WebEidChallengeNonceFilter`for issuing the challenge nonce required by the authentication flow,
120
+
- `WebEidMobileAuthInitFilter`for generating the deep link (`auth_uri`) used in mobile login,
121
+
- `WebEidAjaxLoginProcessingFilter`and `WebEidLoginPageGeneratingFilter` for handling login requests.
118
122
- `service`: Web eID signing service implementation that uses DigiDoc4j, and DigiDoc4j runtime configuration,
119
-
- `web`: Spring Web MVC controller for the welcome page and Spring Web REST controllers that provide endpoints
120
-
- for getting the challenge nonce used by the authentication token validation library,
121
-
- for digital signing.
122
-
- for initializing and handling the mobile login and digital signing flow
123
+
- `web`: Spring Web MVC controller for the welcome page and Spring Web REST controller that provides a digital signing endpoint.
123
124
124
125
The `src/resources` directory contains the resources used by the application:
0 commit comments