aboutsummaryrefslogtreecommitdiff
path: root/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/parser/StartAuthentificationParameterParser.java
diff options
context:
space:
mode:
Diffstat (limited to 'id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/parser/StartAuthentificationParameterParser.java')
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/parser/StartAuthentificationParameterParser.java32
1 files changed, 13 insertions, 19 deletions
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/parser/StartAuthentificationParameterParser.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/parser/StartAuthentificationParameterParser.java
index f538d2d12..587b641c9 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/parser/StartAuthentificationParameterParser.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/parser/StartAuthentificationParameterParser.java
@@ -22,12 +22,10 @@
******************************************************************************/
package at.gv.egovernment.moa.id.auth.parser;
-import java.io.UnsupportedEncodingException;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
import org.apache.commons.lang.StringEscapeUtils;
@@ -36,21 +34,17 @@ import at.gv.egovernment.moa.id.auth.data.AuthenticationSession;
import at.gv.egovernment.moa.id.auth.exception.AuthenticationException;
import at.gv.egovernment.moa.id.auth.exception.MOAIDException;
import at.gv.egovernment.moa.id.auth.exception.WrongParametersException;
-import at.gv.egovernment.moa.id.commons.db.dao.config.TemplateType;
-import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider;
+import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory;
import at.gv.egovernment.moa.id.config.auth.OAAuthParameter;
import at.gv.egovernment.moa.id.moduls.IRequest;
-import at.gv.egovernment.moa.id.moduls.RequestStorage;
import at.gv.egovernment.moa.id.protocols.saml1.SAML1Protocol;
import at.gv.egovernment.moa.id.util.ParamValidatorUtils;
import at.gv.egovernment.moa.logging.Logger;
-import at.gv.egovernment.moa.util.BoolUtils;
import at.gv.egovernment.moa.util.FileUtils;
import at.gv.egovernment.moa.util.MiscUtil;
import at.gv.egovernment.moa.util.StringUtils;
-import at.gv.egovernment.moa.util.URLEncoder;
-public class StartAuthentificationParameterParser implements MOAIDAuthConstants{
+public class StartAuthentificationParameterParser extends MOAIDAuthConstants{
public static void parse(AuthenticationSession moasession,
String target,
@@ -110,7 +104,7 @@ public class StartAuthentificationParameterParser implements MOAIDAuthConstants{
OAAuthParameter oaParam;
if (moasession.getPublicOAURLPrefix() != null) {
Logger.debug("Loading OA parameters for PublicURLPrefix: " + moasession.getPublicOAURLPrefix());
- oaParam = AuthConfigurationProvider.getInstance()
+ oaParam = AuthConfigurationProviderFactory.getInstance()
.getOnlineApplicationParameter(
moasession.getPublicOAURLPrefix());
@@ -119,7 +113,7 @@ public class StartAuthentificationParameterParser implements MOAIDAuthConstants{
new Object[] { moasession.getPublicOAURLPrefix() });
} else {
- oaParam = AuthConfigurationProvider.getInstance()
+ oaParam = AuthConfigurationProviderFactory.getInstance()
.getOnlineApplicationParameter(oaURL);
if (oaParam == null)
@@ -170,7 +164,7 @@ public class StartAuthentificationParameterParser implements MOAIDAuthConstants{
//Validate BKU URI
List<String> allowedbkus = oaParam.getBKUURL();
- allowedbkus.addAll(AuthConfigurationProvider.getInstance().getDefaultBKUURLs());
+ allowedbkus.addAll(AuthConfigurationProviderFactory.getInstance().getDefaultBKUURLs());
if (!ParamValidatorUtils.isValidBKUURI(bkuURL, allowedbkus))
throw new WrongParametersException("StartAuthentication", PARAM_BKU, "auth.12");
@@ -213,12 +207,12 @@ public class StartAuthentificationParameterParser implements MOAIDAuthConstants{
}
authURL = authURL.concat(req.getContextPath() + "/");
- if (!authURL.startsWith("https:") && !AuthConfigurationProvider.getInstance().isHTTPAuthAllowed())
+ if (!authURL.startsWith("https:") && !AuthConfigurationProviderFactory.getInstance().isHTTPAuthAllowed())
throw new AuthenticationException("auth.07",
new Object[] { authURL + "*" });
//set Auth URL from configuration
- moasession.setAuthURL(AuthConfigurationProvider.getInstance().getPublicURLPrefix() + "/");
+ moasession.setAuthURL(AuthConfigurationProviderFactory.getInstance().getPublicURLPrefix() + "/");
//check and set SourceID
if (oaParam.getSAML1Parameter() != null) {
@@ -229,21 +223,21 @@ public class StartAuthentificationParameterParser implements MOAIDAuthConstants{
if (MiscUtil.isEmpty(templateURL)) {
- List<TemplateType> templateURLList = oaParam.getTemplateURL();
+ List<String> templateURLList = oaParam.getTemplateURL();
List<String> defaulTemplateURLList =
- AuthConfigurationProvider.getInstance().getSLRequestTemplates();
+ AuthConfigurationProviderFactory.getInstance().getSLRequestTemplates();
if ( templateURLList != null && templateURLList.size() > 0
- && MiscUtil.isNotEmpty(templateURLList.get(0).getURL()) ) {
+ && MiscUtil.isNotEmpty(templateURLList.get(0)) ) {
templateURL = FileUtils.makeAbsoluteURL(
- oaParam.getTemplateURL().get(0).getURL(),
- AuthConfigurationProvider.getInstance().getRootConfigFileDir());
+ oaParam.getTemplateURL().get(0),
+ AuthConfigurationProviderFactory.getInstance().getRootConfigFileDir());
Logger.info("No SL-Template in request, load SL-Template from OA configuration (URL: " + templateURL + ")");
} else if ( (defaulTemplateURLList.size() > 0) && MiscUtil.isNotEmpty(defaulTemplateURLList.get(0))) {
templateURL = FileUtils.makeAbsoluteURL(
defaulTemplateURLList.get(0),
- AuthConfigurationProvider.getInstance().getRootConfigFileDir());
+ AuthConfigurationProviderFactory.getInstance().getRootConfigFileDir());
Logger.info("No SL-Template in request, load SL-Template from general configuration (URL: " + templateURL + ")");
} else {