aboutsummaryrefslogtreecommitdiff
path: root/id/server/modules/moa-id-modules-federated_authentication
diff options
context:
space:
mode:
authorThomas Lenz <tlenz@iaik.tugraz.at>2016-02-24 06:21:22 +0100
committerThomas Lenz <tlenz@iaik.tugraz.at>2016-02-24 06:21:22 +0100
commitcbdb6946d5af7de63afebf5ad256743303f00935 (patch)
treee5943b5313fc7e41a09a3c4e25aacf6778fc3c2c /id/server/modules/moa-id-modules-federated_authentication
parentf354a38c6287f4834389f3430289ae14241c8066 (diff)
downloadmoa-id-spss-cbdb6946d5af7de63afebf5ad256743303f00935.tar.gz
moa-id-spss-cbdb6946d5af7de63afebf5ad256743303f00935.tar.bz2
moa-id-spss-cbdb6946d5af7de63afebf5ad256743303f00935.zip
refactor PVP protocol implementation to resuse code in other modules
Diffstat (limited to 'id/server/modules/moa-id-modules-federated_authentication')
-rw-r--r--id/server/modules/moa-id-modules-federated_authentication/src/main/java/at/gv/egovernment/moa/id/auth/modules/federatedauth/config/FederatedAuthMetadataConfiguration.java (renamed from id/server/modules/moa-id-modules-federated_authentication/src/main/java/at/gv/egovernment/moa/id/auth/modules/federatedauth/builder/FederatedAuthMetadataBuilder.java)34
1 files changed, 21 insertions, 13 deletions
diff --git a/id/server/modules/moa-id-modules-federated_authentication/src/main/java/at/gv/egovernment/moa/id/auth/modules/federatedauth/builder/FederatedAuthMetadataBuilder.java b/id/server/modules/moa-id-modules-federated_authentication/src/main/java/at/gv/egovernment/moa/id/auth/modules/federatedauth/config/FederatedAuthMetadataConfiguration.java
index 45d76d4fe..29b6ea18b 100644
--- a/id/server/modules/moa-id-modules-federated_authentication/src/main/java/at/gv/egovernment/moa/id/auth/modules/federatedauth/builder/FederatedAuthMetadataBuilder.java
+++ b/id/server/modules/moa-id-modules-federated_authentication/src/main/java/at/gv/egovernment/moa/id/auth/modules/federatedauth/config/FederatedAuthMetadataConfiguration.java
@@ -20,7 +20,7 @@
* The "NOTICE" text file is part of the distribution. Any derivative works
* that you distribute must include a readable copy of the "NOTICE" text file.
*/
-package at.gv.egovernment.moa.id.auth.modules.federatedauth.builder;
+package at.gv.egovernment.moa.id.auth.modules.federatedauth.config;
import java.util.Arrays;
import java.util.List;
@@ -31,13 +31,11 @@ import org.opensaml.saml2.metadata.ContactPerson;
import org.opensaml.saml2.metadata.Organization;
import org.opensaml.saml2.metadata.RequestedAttribute;
import org.opensaml.xml.security.credential.Credential;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
import at.gv.egovernment.moa.id.auth.modules.federatedauth.FederatedAuthConstants;
import at.gv.egovernment.moa.id.auth.modules.federatedauth.utils.FederatedAuthCredentialProvider;
import at.gv.egovernment.moa.id.config.ConfigurationException;
-import at.gv.egovernment.moa.id.protocols.pvp2x.builder.AbstractPVPMetadataBuilder;
+import at.gv.egovernment.moa.id.protocols.pvp2x.config.IPVPMetadataBuilderConfiguration;
import at.gv.egovernment.moa.id.protocols.pvp2x.config.PVPConfiguration;
import at.gv.egovernment.moa.id.protocols.pvp2x.signer.CredentialsNotAvailableException;
import at.gv.egovernment.moa.logging.Logger;
@@ -46,10 +44,20 @@ import at.gv.egovernment.moa.logging.Logger;
* @author tlenz
*
*/
-@Service("FederatedAuthMetadataBuilder")
-public class FederatedAuthMetadataBuilder extends AbstractPVPMetadataBuilder {
+public class FederatedAuthMetadataConfiguration implements IPVPMetadataBuilderConfiguration {
- @Autowired FederatedAuthCredentialProvider credentialProvider;
+
+ private static final int VALIDUNTIL_IN_HOURS = 24;
+
+ private String authURL;
+ private FederatedAuthCredentialProvider credentialProvider;
+
+ public FederatedAuthMetadataConfiguration(String authURL, FederatedAuthCredentialProvider credentialProvider) {
+ this.authURL = authURL;
+ this.credentialProvider = credentialProvider;
+
+ }
+
/* (non-Javadoc)
* @see at.gv.egovernment.moa.id.protocols.pvp2x.builder.AbstractPVPMetadataBuilder#getMetadataValidUntil()
@@ -91,8 +99,8 @@ public class FederatedAuthMetadataBuilder extends AbstractPVPMetadataBuilder {
* @see at.gv.egovernment.moa.id.protocols.pvp2x.builder.AbstractPVPMetadataBuilder#getEntityIDPostfix()
*/
@Override
- public String getEntityIDPostfix() {
- return FederatedAuthConstants.ENDPOINT_METADATA;
+ public String getEntityID() {
+ return authURL + FederatedAuthConstants.ENDPOINT_METADATA;
}
@@ -199,7 +207,7 @@ public class FederatedAuthMetadataBuilder extends AbstractPVPMetadataBuilder {
*/
@Override
public String getSPAssertionConsumerServicePostBindingURL() {
- return FederatedAuthConstants.ENDPOINT_POST;
+ return authURL + FederatedAuthConstants.ENDPOINT_POST;
}
/* (non-Javadoc)
@@ -207,7 +215,7 @@ public class FederatedAuthMetadataBuilder extends AbstractPVPMetadataBuilder {
*/
@Override
public String getSPAssertionConsumerServiceRedirectBindingURL() {
- return FederatedAuthConstants.ENDPOINT_REDIRECT;
+ return authURL + FederatedAuthConstants.ENDPOINT_REDIRECT;
}
/* (non-Javadoc)
@@ -215,7 +223,7 @@ public class FederatedAuthMetadataBuilder extends AbstractPVPMetadataBuilder {
*/
@Override
public String getSPSLOPostBindingURL() {
- return FederatedAuthConstants.ENDPOINT_POST;
+ return authURL + FederatedAuthConstants.ENDPOINT_POST;
}
/* (non-Javadoc)
@@ -223,7 +231,7 @@ public class FederatedAuthMetadataBuilder extends AbstractPVPMetadataBuilder {
*/
@Override
public String getSPSLORedirectBindingURL() {
- return FederatedAuthConstants.ENDPOINT_REDIRECT;
+ return authURL + FederatedAuthConstants.ENDPOINT_REDIRECT;
}
/* (non-Javadoc)