Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
reg-app
Regapp
Commits
2737a367
Commit
2737a367
authored
Nov 15, 2019
by
michael.simon
Browse files
remove bugs
parent
abd57681
Changes
3
Hide whitespace changes
Inline
Side-by-side
bwreg-service/src/main/java/edu/kit/scc/webreg/service/saml/SamlIdpServiceImpl.java
View file @
2737a367
...
...
@@ -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
)));
...
...
bwreg-service/src/main/java/edu/kit/scc/webreg/service/saml/SsoHelper.java
View file @
2737a367
...
...
@@ -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
)));
...
...
bwreg-webapp/src/main/webapp/admin/saml/list-sp-configs.xhtml
View file @
2737a367
...
...
@@ -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}"
/>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment