diff options
author | Andreas Fitzek <andreas.fitzek@iaik.tugraz.at> | 2013-05-28 16:49:00 +0200 |
---|---|---|
committer | Andreas Fitzek <andreas.fitzek@iaik.tugraz.at> | 2013-05-28 16:49:00 +0200 |
commit | 022d3e32f23dc19cdf5530027fee90d58c3fbe6a (patch) | |
tree | a44c07dcf4d77d4f749e1c22170a74c1ce0e4117 /id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/MetadataAction.java | |
parent | 545bda2ed80c3ca45e2be1723a514b21c780a05a (diff) | |
download | moa-id-spss-022d3e32f23dc19cdf5530027fee90d58c3fbe6a.tar.gz moa-id-spss-022d3e32f23dc19cdf5530027fee90d58c3fbe6a.tar.bz2 moa-id-spss-022d3e32f23dc19cdf5530027fee90d58c3fbe6a.zip |
Service URLs configureable
Diffstat (limited to 'id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/MetadataAction.java')
-rw-r--r-- | id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/MetadataAction.java | 93 |
1 files changed, 56 insertions, 37 deletions
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/MetadataAction.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/MetadataAction.java index 75fc6197f..a2bc664e9 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/MetadataAction.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/MetadataAction.java @@ -55,22 +55,25 @@ public class MetadataAction implements IAction { EntityDescriptor idpEntityDescriptor = SAML2Utils .createSAMLObject(EntityDescriptor.class); - idpEntityDescriptor.setEntityID("https://localhost:8443/moa-id-auth"); - - List<ContactPerson> persons = PVPConfiguration.getInstance().getIDPContacts(); - + idpEntityDescriptor + .setEntityID("https://localhost:8443/moa-id-auth"); + + List<ContactPerson> persons = PVPConfiguration.getInstance() + .getIDPContacts(); + idpEntityDescriptor.getContactPersons().addAll(persons); - idpEntityDescriptor.setOrganization(PVPConfiguration.getInstance().getIDPOrganisation()); - + idpEntityDescriptor.setOrganization(PVPConfiguration.getInstance() + .getIDPOrganisation()); + BasicKeyInfoGeneratorFactory keyInfoFactory = new BasicKeyInfoGeneratorFactory(); keyInfoFactory.setEmitPublicKeyValue(true); keyInfoFactory.setEmitEntityIDAsKeyName(true); KeyInfoGenerator keyInfoGenerator = keyInfoFactory.newInstance(); - + Credential credential = CredentialProvider .getIDPSigningCredential(); - + KeyDescriptor signKeyDescriptor = SAML2Utils .createSAMLObject(KeyDescriptor.class); signKeyDescriptor.setUse(UsageType.SIGNING); @@ -81,38 +84,54 @@ public class MetadataAction implements IAction { idpEntityDescriptor.setSignature(signature); - IDPSSODescriptor idpSSODescriptor = SAML2Utils.createSAMLObject(IDPSSODescriptor.class); - + IDPSSODescriptor idpSSODescriptor = SAML2Utils + .createSAMLObject(IDPSSODescriptor.class); + idpSSODescriptor.setWantAuthnRequestsSigned(true); - - SingleSignOnService postSingleSignOnService = - SAML2Utils.createSAMLObject(SingleSignOnService.class); - - postSingleSignOnService.setLocation("https://enter.post.url"); - postSingleSignOnService.setBinding(SAMLConstants.SAML2_POST_BINDING_URI); - - idpSSODescriptor.getSingleSignOnServices().add(postSingleSignOnService); - - SingleSignOnService redirectSingleSignOnService = - SAML2Utils.createSAMLObject(SingleSignOnService.class); - - redirectSingleSignOnService.setLocation("https://enter.redirect.url"); - redirectSingleSignOnService.setBinding(SAMLConstants.SAML2_REDIRECT_BINDING_URI); - - ArtifactResolutionService artifactResolutionService = SAML2Utils.createSAMLObject( - ArtifactResolutionService.class); - - artifactResolutionService.setBinding(SAMLConstants.SAML2_SOAP11_BINDING_URI); - artifactResolutionService.setLocation("https://enter.soap.url"); - - idpSSODescriptor.getArtifactResolutionServices().add(artifactResolutionService); - - idpSSODescriptor.getSingleSignOnServices().add(redirectSingleSignOnService); - + + if (PVPConfiguration.getInstance().getIDPSSOPostService() != null) { + SingleSignOnService postSingleSignOnService = SAML2Utils + .createSAMLObject(SingleSignOnService.class); + + postSingleSignOnService.setLocation(PVPConfiguration + .getInstance().getIDPSSOPostService()); + postSingleSignOnService + .setBinding(SAMLConstants.SAML2_POST_BINDING_URI); + + idpSSODescriptor.getSingleSignOnServices().add( + postSingleSignOnService); + } + + if (PVPConfiguration.getInstance().getIDPSSORedirectService() != null) { + SingleSignOnService redirectSingleSignOnService = SAML2Utils + .createSAMLObject(SingleSignOnService.class); + + redirectSingleSignOnService.setLocation(PVPConfiguration + .getInstance().getIDPSSORedirectService()); + redirectSingleSignOnService + .setBinding(SAMLConstants.SAML2_REDIRECT_BINDING_URI); + + idpSSODescriptor.getSingleSignOnServices().add( + redirectSingleSignOnService); + } + + if (PVPConfiguration.getInstance().getIDPResolveSOAPService() != null) { + ArtifactResolutionService artifactResolutionService = SAML2Utils + .createSAMLObject(ArtifactResolutionService.class); + + artifactResolutionService + .setBinding(SAMLConstants.SAML2_SOAP11_BINDING_URI); + artifactResolutionService.setLocation(PVPConfiguration + .getInstance().getIDPResolveSOAPService()); + + idpSSODescriptor.getArtifactResolutionServices().add( + artifactResolutionService); + } + idpSSODescriptor.getKeyDescriptors().add(signKeyDescriptor); - + idpEntityDescriptor.getRoleDescriptors().add(idpSSODescriptor); - + DocumentBuilder builder; DocumentBuilderFactory factory = DocumentBuilderFactory .newInstance(); |