Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
dariah
dariahsp
Commits
ca3db473
Commit
ca3db473
authored
Apr 20, 2017
by
Gradl, Tobias
Browse files
726: Finalize v1.0 for release with Schema Registry
Task-Url:
https://minfba.de.dariah.eu/mantisbt/view.php?id=726
parent
63c7c8d9
Changes
3
Hide whitespace changes
Inline
Side-by-side
dariahsp-core/src/main/java/eu/dariah/de/dariahsp/saml/web/controller/MetadataController.java
View file @
ca3db473
...
...
@@ -34,6 +34,7 @@ import org.springframework.validation.BindingResult;
import
org.springframework.web.bind.annotation.ModelAttribute
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.servlet.support.ServletUriComponentsBuilder
;
import
eu.dariah.de.dariahsp.saml.web.metadata.MetadataForm
;
import
eu.dariah.de.dariahsp.saml.web.metadata.MetadataValidator
;
...
...
@@ -118,7 +119,7 @@ public class MetadataController {
}
@RequestMapping
(
value
=
"/create"
)
public
String
createMetadata
(
@ModelAttribute
(
"metadata"
)
MetadataForm
metadata
,
BindingResult
bindingResult
,
Model
model
)
throws
MetadataProviderException
,
MarshallingException
,
KeyStoreException
{
public
String
createMetadata
(
@ModelAttribute
(
"metadata"
)
MetadataForm
metadata
,
HttpServletRequest
request
,
BindingResult
bindingResult
,
Model
model
)
throws
MetadataProviderException
,
MarshallingException
,
KeyStoreException
{
new
MetadataValidator
(
metadataManager
).
validate
(
metadata
,
bindingResult
);
...
...
@@ -226,7 +227,7 @@ public class MetadataController {
}
return
displayMetadata
(
generatedDescriptor
,
generatedExtendedMetadata
,
model
);
return
displayMetadata
(
request
,
generatedDescriptor
,
generatedExtendedMetadata
,
model
);
}
...
...
@@ -239,7 +240,7 @@ public class MetadataController {
* @throws MarshallingException in case de-serialization into string fails
*/
@RequestMapping
(
value
=
"/display"
)
public
String
displayMetadata
(
@RequestParam
(
"entityId"
)
String
entityId
,
Model
model
)
throws
MetadataProviderException
,
MarshallingException
{
public
String
displayMetadata
(
@RequestParam
(
"entityId"
)
String
entityId
,
HttpServletRequest
request
,
Model
model
)
throws
MetadataProviderException
,
MarshallingException
{
EntityDescriptor
entityDescriptor
=
metadataManager
.
getEntityDescriptor
(
entityId
);
ExtendedMetadata
extendedMetadata
=
metadataManager
.
getExtendedMetadata
(
entityId
);
...
...
@@ -248,11 +249,11 @@ public class MetadataController {
throw
new
MetadataProviderException
(
"Metadata with ID "
+
entityId
+
" not found"
);
}
return
displayMetadata
(
entityDescriptor
,
extendedMetadata
,
model
);
return
displayMetadata
(
request
,
entityDescriptor
,
extendedMetadata
,
model
);
}
protected
String
displayMetadata
(
EntityDescriptor
entityDescriptor
,
ExtendedMetadata
extendedMetadata
,
Model
model
)
throws
MarshallingException
{
protected
String
displayMetadata
(
HttpServletRequest
request
,
EntityDescriptor
entityDescriptor
,
ExtendedMetadata
extendedMetadata
,
Model
model
)
throws
MarshallingException
{
MetadataForm
metadata
=
new
MetadataForm
();
String
fileName
=
getFileName
(
entityDescriptor
);
...
...
@@ -308,7 +309,7 @@ public class MetadataController {
model
.
addAttribute
(
"baseUrl"
,
ServletUriComponentsBuilder
.
fromServletMapping
(
request
).
build
().
toUriString
());
model
.
addAttribute
(
"metadata"
,
metadata
);
model
.
addAttribute
(
"storagePath"
,
fileName
);
...
...
dariahsp-core/src/main/java/eu/dariah/de/dariahsp/saml/web/metadata/MetadataForm.java
View file @
ca3db473
...
...
@@ -58,6 +58,7 @@ public class MetadataForm {
private
boolean
requireLogoutRequestSigned
;
private
boolean
requireLogoutResponseSigned
;
private
boolean
requireArtifactResolveSigned
;
private
boolean
requireAttributeQuerySigned
;
public
MetadataForm
()
{
}
...
...
@@ -278,4 +279,11 @@ public class MetadataForm {
this
.
signingAlgorithm
=
signingAlgorithm
;
}
public
boolean
isRequireAttributeQuerySigned
()
{
return
requireAttributeQuerySigned
;
}
public
void
setRequireAttributeQuerySigned
(
boolean
requireAttributeQuerySigned
)
{
this
.
requireAttributeQuerySigned
=
requireAttributeQuerySigned
;
}
}
dariahsp-sample/src/main/webapp/WEB-INF/view/jsp/saml/metadataView.jsp
View file @
ca3db473
...
...
@@ -96,29 +96,33 @@
<label
class=
"col-sm-3 control-label"
>
Configuration:
</label>
<div
class=
"col-sm-9"
>
<textarea
id=
"configuration"
readonly=
"readonly"
class=
"form-control"
rows=
"12"
>
# Append these properties to your application configuration
# Make sure that any [saml.sp.*] options are overwritten
# Modify this property to point to the downloaded SP metadata
saml.sp.externalMetadata = /path/to/downloaded/spring-saml-metadata.xml
saml.sp.alias = ${metadata.alias}
saml.sp.entityId = ${metadata.entityId}
saml.sp.securityProfile = ${metadata.securityProfile}
saml.sp.sslSecurityProfile = ${metadata.sslSecurityProfile}
saml.sp.sslHostnameVerification = ${metadata.sslHostnameVerification}
saml.sp.signMetadata = ${metadata.signMetadata}
saml.sp.signingAlgorithm = ${metadata.signingAlgorithm}
saml.sp.signingKey = ${metadata.signingKey}
saml.sp.encryptionKey = ${metadata.encryptionKey}
saml.sp.tlsKey = ${metadata.tlsKey}
saml.sp.requireArtifactResolveSigned = ${metadata.requireArtifactResolveSigned}
saml.sp.requireAttributeQuerySigned = ${metadata.requireAttributeQuerySigned}
saml.sp.requireLogoutRequestSigned = ${metadata.requireLogoutRequestSigned}
saml.sp.requireLogoutResponseSigned = ${metadata.requireLogoutResponseSigned}
saml.sp.discovery.enabled = ${metadata.includeDiscovery}
saml.sp.discovery.url = ${metadata.customDiscoveryURL}
saml.sp.discovery.return = ${metadata.customDiscoveryResponseURL}
saml.sp.allowedNameIds =
<c:forEach
begin=
"0"
end=
"
${
fn:
length
(
metadata
.
nameID
)
-
1
}
"
var=
"index"
><c:out
value=
"
${
metadata
.
nameID
[
index
]
}
"
/><c:if
test=
"
${
index
<
fn:
length
(
metadata
.
nameID
)-
1
}
"
>
,
</c:if></c:forEach>
saml.sp.
auth:
...
saml:
...
sp:
# Modify this property to point to the downloaded SP metadata
externalMetadata = /path/to/downloaded/spring-saml-metadata.xml
alias = ${metadata.alias}
baseUrl = ${baseUrl}
entityId = ${metadata.entityId}
securityProfile = ${metadata.securityProfile}
sslSecurityProfile = ${metadata.sslSecurityProfile}
sslHostnameVerification = ${metadata.sslHostnameVerification}
signMetadata = ${metadata.signMetadata}
signingAlgorithm = ${metadata.signingAlgorithm}
signingKey = ${metadata.signingKey}
encryptionKey = ${metadata.encryptionKey}
tlsKey = ${metadata.tlsKey}
requireArtifactResolveSigned = ${metadata.requireArtifactResolveSigned}
requireAttributeQuerySigned = ${metadata.requireAttributeQuerySigned}
requireLogoutRequestSigned = ${metadata.requireLogoutRequestSigned}
requireLogoutResponseSigned = ${metadata.requireLogoutResponseSigned}
discovery.enabled = ${metadata.includeDiscovery}
discovery.url = ${metadata.customDiscoveryURL}
discovery.return = ${metadata.customDiscoveryResponseURL}
allowedNameIds =
<c:forEach
begin=
"0"
end=
"
${
fn:
length
(
metadata
.
nameID
)
-
1
}
"
var=
"index"
><c:out
value=
"
${
metadata
.
nameID
[
index
]
}
"
/><c:if
test=
"
${
index
<
fn:
length
(
metadata
.
nameID
)-
1
}
"
>
,
</c:if></c:forEach>
</textarea>
</div>
</div>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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