Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make SAML binding configurable via idp.saml_binding #86

Merged
merged 2 commits into from
Aug 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions mujina-idp/src/main/java/mujina/idp/MetadataController.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ public class MetadataController {
private IdpConfiguration idpConfiguration;

@Autowired
Environment environment;
private Environment environment;

@Value("${idp.saml_binding}")
private String samlBinding;

@Autowired
@RequestMapping(method = RequestMethod.GET, value = "/metadata", produces = "application/xml")
Expand Down Expand Up @@ -73,7 +76,7 @@ public String metadata(@Value("${idp.base_url}") String idpBaseUrl) throws Secur

SingleSignOnService singleSignOnService = buildSAMLObject(SingleSignOnService.class, SingleSignOnService.DEFAULT_ELEMENT_NAME);
singleSignOnService.setLocation(idpBaseUrl + "/SingleSignOnService");
singleSignOnService.setBinding(SAMLConstants.SAML2_REDIRECT_BINDING_URI);
singleSignOnService.setBinding(samlBinding);

idpssoDescriptor.getSingleSignOnServices().add(singleSignOnService);

Expand Down
2 changes: 2 additions & 0 deletions mujina-idp/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ idp:
expires: 300
# Authentication method ALL for every username / password combination and USER for the configured users
auth_method: ALL
# SAML binding type
saml_binding: urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect
# Are endpoints compared. If so then pay notice to the base_url when behind a load balancer
compare_endpoints: true
# SAML configuration file. To use an external file, prefix path with "file:".
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ public void metadata() throws Exception {
.statusCode(SC_OK)
.body(
"EntityDescriptor.IDPSSODescriptor.SingleSignOnService.@Location",
equalTo(idpBaseUrl + "/SingleSignOnService"));
equalTo(idpBaseUrl + "/SingleSignOnService"))
.body("EntityDescriptor.IDPSSODescriptor.SingleSignOnService.@Binding",
equalTo("urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"));;
}

}
Expand Down
Loading