Skip to content

Instantly share code, notes, and snippets.

@nov
Last active January 19, 2018 02:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nov/279be56c87d33de8ce20bf39575ebb34 to your computer and use it in GitHub Desktop.
Save nov/279be56c87d33de8ce20bf39575ebb34 to your computer and use it in GitHub Desktop.
SAML2 Unavailable Gakunin SPs
require 'saml'
require 'open-uri'
idps_and_sps = Saml::Elements::EntityDescriptor.parse(
open('https://metadata.gakunin.nii.ac.jp/gakunin-metadata.xml?generation=2')
)
sps = idps_and_sps.select do |idp_or_sp|
idp_or_sp.sp_sso_descriptor.present?
end
only_saml1 = sps.select do |sp|
!sp.sp_sso_descriptor.protocol_support_enumeration.include?('urn:oasis:names:tc:SAML:2.0:protocol')
end
saml2_post_binding_unavailable = sps.select do |sp|
bindings = sp.sp_sso_descriptor.assertion_consumer_services.collect(&:binding)
!bindings.include?('urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST')
end
saml2_post_binding_unavailable.collect(&:entity_id)
# ["https://www.pieronline.jp/shibboleth",
# "https://attrviewer13.gakunin.nii.ac.jp/shibboleth-sp",
# "https://auth.cs.serialssolutions.com/auth/Metadata/Shib",
# "https://auth.search.serialssolutions.com/auth/Metadata/Shib",
# "https://auth.galegroup.com/shibboleth"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment