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
+
Request Filters that issue challenge nonces for regular Web eID and Web eID for Mobile authentication flows are required for authentication.
140
+
The filters 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 for regualar Web eID authentication flow.
143
+
See the full implementation [here](example/src/main/java/eu/webeid/example/security/WebEidChallengeNonceFilter.java).
Similarly, the `WebEidMobileAuthInitFilter` handles `/auth/mobile/init` requests for Web eID for Mobile authentication flow by generating a challenge nonce and returning a deep link URI. This deep link contains both the challenge nonce and a login URI for the mobile authentication flow.
178
+
See the full implementation [here](example/src/main/java/eu/webeid/example/security/WebEidMobileAuthInitFilter.java).
153
179
154
-
@Autowired// for brevity, prefer constructor dependency injection
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
+8-5Lines changed: 8 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -100,7 +100,8 @@ This repository contains the code of a minimal Spring Boot web application that
100
100
- Spring Security,
101
101
- the Web eID authentication token validation library [_web-eid-authtoken-validation-java_](https://github.com/web-eid/web-eid-authtoken-validation-java),
102
102
- the Web eID JavaScript library [_web-eid.js_](https://github.com/web-eid/web-eid.js),
103
-
- the digital signing library [_DigiDoc4j_](https://github.com/open-eid/digidoc4j).
103
+
- the digital signing library [_DigiDoc4j_](https://github.com/open-eid/digidoc4j),
104
+
- the Android application [_MOPP-Android_](https://github.com/open-eid/MOPP-Android/).
104
105
105
106
The project uses Maven for managing the dependencies and building the application. Maven project configuration file `pom.xml` is in the root of the project.
106
107
@@ -113,11 +114,13 @@ The source code folder `src` contains the application source code and resources
113
114
The `src/main/java/eu/webeid/example` directory contains the Spring Boot application Java class and the following subdirectories:
114
115
115
116
- `config`: Spring and HTTP security configuration, Web eID authentication token validation library configuration, trusted CA certificates loading etc,
116
-
- `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 issuing the challenge nonce and generating the deep link with the authentication request, used to initiate the mobile authentication flow,
121
+
- `WebEidAjaxLoginProcessingFilter`and `WebEidLoginPageGeneratingFilter` for handling login requests.
117
122
- `service`: Web eID signing service implementation that uses DigiDoc4j, and DigiDoc4j runtime configuration,
118
-
- `web`: Spring Web MVC controller for the welcome page and Spring Web REST controllers that provide endpoints
119
-
- for getting the challenge nonce used by the authentication token validation library,
120
-
- for digital signing.
123
+
- `web`: Spring Web MVC controller for the welcome page and Spring Web REST controller that provides a digital signing endpoint.
121
124
122
125
The `src/resources` directory contains the resources used by the application:
0 commit comments