Frankly we're using existing open source to handle this - we use ruby-saml which is maintained by OneLogin for the SAML parsing, but we also wrote a little ts parser for federated metadata files - https://github.com/enterprise-oss/osso-react/blob/main/src/u...