This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
web-integration:java-example [2019/08/15 06:04] 740803864 [Open Check] |
web-integration:java-example [2020/02/29 10:52] (current) mpospisek |
||
|---|---|---|---|
| Line 25: | Line 25: | ||
| ==== Open ==== | ==== Open ==== | ||
| First one starts authentication process: | First one starts authentication process: | ||
| - | <code java> | + | <sxh java> |
| @WebServlet("/ | @WebServlet("/ | ||
| public class OpenServlet extends HttpServlet { | public class OpenServlet extends HttpServlet { | ||
| Line 67: | Line 67: | ||
| } | } | ||
| - | </code> | + | </sxh> |
| Some minor notes to source code: | Some minor notes to source code: | ||
| * way to get '' | * way to get '' | ||
| Line 76: | Line 76: | ||
| This servlet asks for authentication operation status: | This servlet asks for authentication operation status: | ||
| - | <code java> | + | <sxh java> |
| @WebServlet("/ | @WebServlet("/ | ||
| public class ProxyServlet extends HttpServlet { | public class ProxyServlet extends HttpServlet { | ||
| Line 109: | Line 109: | ||
| } | } | ||
| - | </code> | + | </sxh> |
| Notes to source code: | Notes to source code: | ||
| Line 116: | Line 116: | ||
| ==== Open Check ==== | ==== Open Check ==== | ||
| Servlet evaluating authentication operation result: | Servlet evaluating authentication operation result: | ||
| - | <code java> | + | <sxh java> |
| @WebServlet("/ | @WebServlet("/ | ||
| public class OpenCheckServlet extends HttpServlet { | public class OpenCheckServlet extends HttpServlet { | ||
| Line 153: | Line 153: | ||
| } | } | ||
| - | </code> | + | </sxh> |
| Some notes to source code: | Some notes to source code: | ||
| * way to get '' | * way to get '' | ||
| - | ==== Web Application Configuration File ==== | + | |
| + | ===== Web Integration ===== | ||
| + | |||
| + | ==== Start Page ==== | ||
| + | |||
| + | Servlets described earlier are used in '' | ||
| + | |||
| + | <sxh javascript> | ||
| + | <html xmlns=" | ||
| + | |||
| + | < | ||
| + | <script type=" | ||
| + | <script type=" | ||
| + | |||
| + | <script type=" | ||
| + | var aducid = new ADUCID(); | ||
| + | $(document).ready(function() { | ||
| + | aducid.setAuthentication(); | ||
| + | |||
| + | aducid.setStartOperationUrl(" | ||
| + | aducid.setResultOperationUrl(" | ||
| + | aducid.setProxyUrl(" | ||
| + | |||
| + | aducid.processResult = function(result) { | ||
| + | if (result.status == " | ||
| + | alert(" | ||
| + | location.href = result.redirect; | ||
| + | } else { | ||
| + | alert(" | ||
| + | location.href = result.redirect; | ||
| + | } | ||
| + | } | ||
| + | |||
| + | // handle PEIG not installed error | ||
| + | aducid.showPeigError = function() { | ||
| + | alert(" | ||
| + | } | ||
| + | |||
| + | // handle communication or other error | ||
| + | aducid.handleError = function(e) { | ||
| + | alert(e.data.message); | ||
| + | } | ||
| + | |||
| + | aducid.showQRHint = function(param) { | ||
| + | $('# | ||
| + | } | ||
| + | |||
| + | aducid.showRunningHint = function(param) { | ||
| + | $('# | ||
| + | }; | ||
| + | |||
| + | aducid.startAnimation = function() { | ||
| + | $("# | ||
| + | }; | ||
| + | |||
| + | aducid.stopRunningAnimation = function() { | ||
| + | $("# | ||
| + | }; | ||
| + | |||
| + | // GUI mapping | ||
| + | aducid.setButton($("# | ||
| + | aducid.setQrCode($("# | ||
| + | aducid.setQrHint($("# | ||
| + | |||
| + | // start | ||
| + | aducid.init(); | ||
| + | }); | ||
| + | </ | ||
| + | </ | ||
| + | < | ||
| + | |||
| + | < | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | <img id=" | ||
| + | <div id=" | ||
| + | |||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | ==== Result Page ==== | ||
| + | |||
| + | After successful authentication, | ||
| + | |||
| + | <sxh javascript> | ||
| + | <html xmlns=" | ||
| + | |||
| + | < | ||
| + | </ | ||
| + | < | ||
| + | |||
| + | < | ||
| + | UDI: ${result.userDatabaseIndex} | ||
| + | < | ||
| + | <a href=" | ||
| + | |||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| + | ===== Web Application Configuration File ===== | ||
| + | This file is required by Servlet API. File provides '' | ||
| + | |||
| + | <code xml> | ||
| + | <?xml version=" | ||
| + | <web-app xmlns: | ||
| + | xsi: | ||
| + | version=" | ||
| + | |||
| + | < | ||
| + | |||
| + | < | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | |||
| + | </ | ||
| + | </ | ||
| + | |||
| + | Value '' | ||
| + | |||
| + | ===== Maven Configuration File ===== | ||
| + | |||
| + | Maven configuration file contents definition of plugin to generate WS classes and instruction to filter '' | ||
| + | |||
| + | <sxh xml> | ||
| + | <?xml version=" | ||
| + | <project xmlns=" | ||
| + | xsi: | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | </ | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | < | ||
| + | </ | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | </ | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| + | ===== Building Application ===== | ||
| + | |||
| + | There is prepared batch file '' | ||
| + | |||
| + | <sxh bash> | ||
| + | set MAVEN_OPTS=" | ||
| + | mvn -Dws.url=https:// | ||
| + | </ | ||