-
Notifications
You must be signed in to change notification settings - Fork 164
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
Add Ability to define logout_endpoint and its binding in order to generate a proper metadata file #159
Open
miguelfreitas93
wants to merge
3
commits into
Clever:master
Choose a base branch
from
miguelfreitas93:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add Ability to define logout_endpoint and its binding in order to generate a proper metadata file #159
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,7 +60,7 @@ sign_authn_request = (xml, private_key, options) -> | |
return signer.getSignedXml() | ||
|
||
# Creates metadata and returns it as a string of XML. The metadata has one POST assertion endpoint. | ||
create_metadata = (entity_id, assert_endpoint, signing_certificates, encryption_certificates) -> | ||
create_metadata = (entity_id, assert_endpoint, logout_endpoint, logout_binding, signing_certificates, encryption_certificates) -> | ||
signing_cert_descriptors = for signing_certificate in signing_certificates or [] | ||
{'md:KeyDescriptor': certificate_to_keyinfo('signing', signing_certificate)} | ||
|
||
|
@@ -79,8 +79,8 @@ create_metadata = (entity_id, assert_endpoint, signing_certificates, encryption_ | |
.concat encryption_cert_descriptors | ||
.concat [ | ||
'md:SingleLogoutService': | ||
'@Binding': 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect' | ||
'@Location': assert_endpoint | ||
'@Binding': 'urn:oasis:names:tc:SAML:2.0:bindings:' + logout_binding | ||
'@Location': logout_endpoint | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. logout_endpoint should be validated if it is a valid URL |
||
'md:AssertionConsumerService': | ||
'@Binding': 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST' | ||
'@Location': assert_endpoint | ||
|
@@ -498,8 +498,10 @@ module.exports.ServiceProvider = | |
# | ||
# Rest of options can be set/overwritten by the identity provider and/or at function call. | ||
constructor: (options) -> | ||
{@entity_id, @private_key, @certificate, @assert_endpoint, @alt_private_keys, @alt_certs} = options | ||
{@entity_id, @private_key, @certificate, @assert_endpoint, @logout_endpoint, @logout_binding, @alt_private_keys, @alt_certs} = options | ||
|
||
@logout_endpoint ?= @assert_endpoint | ||
@logout_binding ?= "HTTP-Redirect" | ||
options.audience ?= @entity_id | ||
options.notbefore_skew ?= 1 | ||
|
||
|
@@ -709,7 +711,7 @@ module.exports.ServiceProvider = | |
# XML metadata, used during initial SAML configuration | ||
create_metadata: => | ||
certs = [@certificate].concat @alt_certs | ||
create_metadata @entity_id, @assert_endpoint, certs, certs | ||
create_metadata @entity_id, @assert_endpoint, @logout_endpoint, @logout_binding, certs, certs | ||
|
||
module.exports.IdentityProvider = | ||
class IdentityProvider | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logout_binding should be validated with a whitelist