Mercurial > dive4elements > river
comparison gwt-client/src/main/java/org/dive4elements/river/client/server/auth/was/Authenticator.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 | 2c8259176c46 |
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.auth.was; | 9 package org.dive4elements.river.client.server.auth.was; |
10 | 10 |
11 import java.io.File; | |
11 import java.io.IOException; | 12 import java.io.IOException; |
12 import java.security.GeneralSecurityException; | 13 import java.security.GeneralSecurityException; |
13 import javax.servlet.ServletContext; | 14 import javax.servlet.ServletContext; |
14 | 15 |
15 import org.apache.http.HttpEntity; | 16 import org.apache.http.HttpEntity; |
60 if (entity == null) { | 61 if (entity == null) { |
61 //FIXME throw AuthenticationException | 62 //FIXME throw AuthenticationException |
62 return null; | 63 return null; |
63 } | 64 } |
64 else { | 65 else { |
65 String trustedKey = | 66 File trustedKey = new File( |
66 (String)context.getInitParameter("saml-trusted-public-key"); | 67 context.getInitParameter("saml-trusted-public-key")); |
68 String path = trustedKey.isAbsolute() | |
69 ? trustedKey.getPath() | |
70 : context.getRealPath(trustedKey.getPath()); | |
67 String timeEpsilon = context.getInitParameter( | 71 String timeEpsilon = context.getInitParameter( |
68 "saml-time-tolerance"); | 72 "saml-time-tolerance"); |
69 return new Response(entity, username, password, features, | 73 return new Response(entity, username, password, features, |
70 context.getRealPath(trustedKey), timeEpsilon); | 74 path, timeEpsilon); |
71 } | 75 } |
72 } | 76 } |
73 catch(GeneralSecurityException e) { | 77 catch(GeneralSecurityException e) { |
74 throw new AuthenticationException(e); | 78 throw new AuthenticationException(e); |
75 } | 79 } |