Commit 2737a367 authored by michael.simon's avatar michael.simon
Browse files

remove bugs

parent abd57681
......@@ -169,7 +169,7 @@ public class SamlIdpServiceImpl implements SamlIdpService {
assertion.setID(samlHelper.getRandomId());
assertion.setIssueInstant(new DateTime());
assertion.setIssuer(ssoHelper.buildIssuser(idpConfig.getEntityId()));
assertion.setSubject(ssoHelper.buildSubject(samlHelper.getRandomId(), NameID.TRANSIENT, authnRequest.getID()));
assertion.setSubject(ssoHelper.buildSubject(idpConfig, spMetadata, samlHelper.getRandomId(), NameID.TRANSIENT, authnRequest.getID()));
assertion.setConditions(ssoHelper.buildConditions(spMetadata));
assertion.getAttributeStatements().add(buildAttributeStatement(user, serviceSamlSpEntityList, registry));
assertion.getAuthnStatements().add(ssoHelper.buildAuthnStatement((5L * 60L * 1000L)));
......
......@@ -22,6 +22,7 @@ import org.opensaml.saml.common.SAMLVersion;
import org.opensaml.saml.saml2.core.SubjectConfirmation;
import org.opensaml.saml.saml2.core.SubjectConfirmationData;
import edu.kit.scc.webreg.entity.SamlIdpConfigurationEntity;
import edu.kit.scc.webreg.entity.SamlSpMetadataEntity;
import org.opensaml.saml.saml2.core.Attribute;
......@@ -98,12 +99,13 @@ public class SsoHelper implements Serializable {
return issuer;
}
public Subject buildSubject(String nameIdValue, String nameIdType, String inResponseTo) {
public Subject buildSubject(SamlIdpConfigurationEntity idpConfig, SamlSpMetadataEntity spMetadata,
String nameIdValue, String nameIdType, String inResponseTo) {
NameID nameId = samlHelper.create(NameID.class, NameID.DEFAULT_ELEMENT_NAME);
nameId.setFormat(nameIdType);
nameId.setValue(nameIdValue);
nameId.setNameQualifier("https://bwidm.scc.kit.edu/saml/idp/metadata");
nameId.setSPNameQualifier("https://bwidm-dev.scc.kit.edu/nextcloud/index.php/apps/user_saml/saml/metadata");
nameId.setNameQualifier(idpConfig.getEntityId());
nameId.setSPNameQualifier(spMetadata.getEntityId());
SubjectConfirmationData scd = samlHelper.create(SubjectConfirmationData.class, SubjectConfirmationData.DEFAULT_ELEMENT_NAME);
scd.setNotOnOrAfter(new DateTime(System.currentTimeMillis() + (5L * 60L * 1000L)));
......
......@@ -52,6 +52,23 @@
</p:column>
</p:dataTable>
<p:dataTable id="idpDataTable" var="entity" value="#{listSamlConfigurationBean.idpList}">
<p:column>
<f:facet name="header">
<h:outputText value="#{messages.id}" />
</f:facet>
<h:outputText value="#{entity.id}" />
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="#{messages.entity_id}" />
</f:facet>
<h:link outcome="show-idp-config.xhtml" value="#{entity.entityId}">
<f:param name="id" value="#{entity.id}"/>
</h:link>
</p:column>
</p:dataTable>
<h:link outcome="add-sp-config.xhtml" value="#{messages.add_sp_config}"/><br/>
<h:link outcome="add-aa-config.xhtml" value="#{messages.add_aa_config}"/><br/>
<h:link outcome="add-idp-config.xhtml" value="#{messages.add_idp_config}"/>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment