tkqubo / saml-metadata   0.1.7

MIT License GitHub

Saml metadata written in Scala

Scala versions: 2.12 2.11

SAML metadata

Maven Central Circle CI Coverage Status License: MIT

About

SAML V2.0 Metadata representation written in Scala

See:

Usage

import oasis.names.tc.saml._2_0.metadata._
import java.net.URL
import scala.xml.XML

val url = "https://svn.sdsc.edu/repo/NGBW/misc/trunk/misc/documents/shibboleth_config/etc_shibboleth/example-metadata.xml"
val xml = XML.load(new URL(url))
val descriptor: EntityDescriptor = EntityDescriptor.reader.read(xml)

println(descriptor.entityId)
// https://idp.example.org/shibboleth

println(descriptor.idpSsoDescriptors.flatMap(_.singleSignOnServices).map(_.location))
// List(https://idp.example.org/shibboleth/profile/shibboleth/SSO, https://idp.example.org/shibboleth/profile/saml2/Redirect/SSO, https://idp.example.org/shibboleth/profile/saml2/POST/SSO)