Mercurial > dive4elements > river
comparison gwt-client/src/main/java/org/dive4elements/river/client/server/SamlServlet.java @ 9747:cfc0aab9947f 3.2.x
Enable bind-mounting client configuration in docker container
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Mon, 05 Sep 2022 17:55:32 +0200 |
parents | 0a5239a1e46e |
children |
comparison
equal
deleted
inserted
replaced
9746:1a1e627b1483 | 9747:cfc0aab9947f |
---|---|
6 * documentation coming with Dive4Elements River for details. | 6 * documentation coming with Dive4Elements River for details. |
7 */ | 7 */ |
8 | 8 |
9 package org.dive4elements.river.client.server; | 9 package org.dive4elements.river.client.server; |
10 | 10 |
11 import java.io.File; | |
11 import java.io.IOException; | 12 import java.io.IOException; |
12 import java.io.InputStream; | 13 import java.io.InputStream; |
13 import java.io.StringBufferInputStream; | 14 import java.io.StringBufferInputStream; |
14 | 15 |
15 import javax.servlet.ServletException; | 16 import javax.servlet.ServletException; |
69 { | 70 { |
70 ServletContext sc = this.getServletContext(); | 71 ServletContext sc = this.getServletContext(); |
71 | 72 |
72 Assertion assertion = null; | 73 Assertion assertion = null; |
73 try { | 74 try { |
74 String keyfile = | 75 File keyfile = new File( |
75 (String)sc.getInitParameter("saml-trusted-public-key"); | 76 sc.getInitParameter("saml-trusted-public-key")); |
77 String path = keyfile.isAbsolute() | |
78 ? keyfile.getPath() | |
79 : sc.getRealPath(keyfile.getPath()); | |
76 int timeEps = Integer.parseInt( | 80 int timeEps = Integer.parseInt( |
77 sc.getInitParameter("saml-time-tolerance")); | 81 sc.getInitParameter("saml-time-tolerance")); |
78 TicketValidator validator = | 82 TicketValidator validator = new TicketValidator(path, timeEps); |
79 new TicketValidator(sc.getRealPath(keyfile), timeEps); | |
80 | 83 |
81 InputStream in = new StringBufferInputStream(samlTicketXML); | 84 InputStream in = new StringBufferInputStream(samlTicketXML); |
82 assertion = validator.checkTicket(new Base64InputStream(in)); | 85 assertion = validator.checkTicket(new Base64InputStream(in)); |
83 } | 86 } |
84 catch (Exception e) { | 87 catch (Exception e) { |