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
20d0ef74
Commit
20d0ef74
authored
Apr 26, 2016
by
michael.simon
Browse files
small steps forward
parent
344ddfe3
Changes
3
Hide whitespace changes
Inline
Side-by-side
bwreg-service/src/main/java/edu/kit/scc/webreg/service/saml/AttributeQueryHelper.java
View file @
20d0ef74
...
...
@@ -17,8 +17,6 @@ import javax.enterprise.context.ApplicationScoped;
import
javax.inject.Inject
;
import
javax.inject.Named
;
import
net.shibboleth.utilities.java.support.httpclient.HttpClientBuilder
;
import
org.apache.http.client.HttpClient
;
import
org.apache.http.impl.client.HttpClients
;
import
org.joda.time.DateTime
;
...
...
@@ -35,6 +33,7 @@ import org.opensaml.saml.saml2.core.Response;
import
org.opensaml.saml.saml2.core.Subject
;
import
org.opensaml.saml.saml2.metadata.AttributeService
;
import
org.opensaml.saml.saml2.metadata.EntityDescriptor
;
import
org.opensaml.soap.messaging.context.SOAP11Context
;
import
org.opensaml.soap.soap11.Body
;
import
org.opensaml.soap.soap11.Envelope
;
import
org.slf4j.Logger
;
...
...
@@ -70,14 +69,17 @@ public class AttributeQueryHelper implements Serializable {
AttributeQuery
attrQuery
=
buildAttributeQuery
(
persistentId
,
spEntity
.
getEntityId
());
//
Envelope envelope = buildSOAP11Envelope(attrQuery);
Envelope
envelope
=
buildSOAP11Envelope
(
attrQuery
);
MessageContext
<
SAMLObject
>
inbound
=
new
MessageContext
<
SAMLObject
>();
MessageContext
<
SAMLObject
>
outbound
=
new
MessageContext
<
SAMLObject
>();
outbound
.
setMessage
(
attrQuery
);
InOutOperationContext
<
SAMLObject
,
SAMLObject
>
inOutContext
=
new
InOutOperationContext
<
SAMLObject
,
SAMLObject
>(
inbound
,
outbound
);
MessageContext
<
Envelope
>
outbound
=
new
MessageContext
<
Envelope
>();
outbound
.
setMessage
(
envelope
);
SOAP11Context
soapContext
=
new
SOAP11Context
();
soapContext
.
setEnvelope
(
envelope
);
outbound
.
addSubcontext
(
soapContext
);
InOutOperationContext
<
SAMLObject
,
Envelope
>
inOutContext
=
new
InOutOperationContext
<
SAMLObject
,
Envelope
>(
inbound
,
outbound
);
// BasicSOAPMessageContext soapContext = new BasicSOAPMessageContext();
// soapContext.setOutboundMessage(envelope);
...
...
bwreg-service/src/main/java/edu/kit/scc/webreg/service/saml/Saml2ResponseValidationService.java
View file @
20d0ef74
...
...
@@ -129,6 +129,7 @@ public class Saml2ResponseValidationService {
throw
new
SamlAuthenticationException
(
"No Signature on SignableSamlObject"
);
DOMMetadataResolver
mp
=
new
DOMMetadataResolver
(
entityDescriptor
.
getDOM
());
mp
.
setId
(
entityDescriptor
.
getEntityID
()
+
"-resolver"
);
try
{
mp
.
initialize
();
}
catch
(
ComponentInitializationException
e
)
{
...
...
bwreg-service/src/main/java/edu/kit/scc/webreg/service/saml/SamlHelper.java
View file @
20d0ef74
...
...
@@ -24,6 +24,7 @@ import javax.inject.Inject;
import
javax.inject.Named
;
import
javax.xml.namespace.QName
;
import
net.shibboleth.utilities.java.support.component.ComponentInitializationException
;
import
net.shibboleth.utilities.java.support.xml.BasicParserPool
;
import
net.shibboleth.utilities.java.support.xml.SerializeSupport
;
import
net.shibboleth.utilities.java.support.xml.XMLParserException
;
...
...
@@ -70,6 +71,11 @@ public class SamlHelper implements Serializable {
public
void
init
()
{
basicParserPool
=
new
BasicParserPool
();
basicParserPool
.
setNamespaceAware
(
true
);
try
{
basicParserPool
.
initialize
();
}
catch
(
ComponentInitializationException
e
)
{
logger
.
error
(
"Init of ParserPool failed"
,
e
);
}
XMLObjectProviderRegistry
registry
;
synchronized
(
ConfigurationService
.
class
)
{
...
...
@@ -83,6 +89,7 @@ public class SamlHelper implements Serializable {
marshallerFactory
=
registry
.
getMarshallerFactory
();
unmarshallerFactory
=
registry
.
getUnmarshallerFactory
();
builderFactory
=
registry
.
getBuilderFactory
();
}
public
String
getRandomId
()
{
...
...
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