Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.