# Shin Workbook ```elixir Mix.install([{:shin, ">= 0.2.0"}]) alias Shin.{Metadata, Attributes} ``` ## 1. Defining an IdP You'll need to change the URL to the base URL of your own IdP service. You'll need access to the admin endpoints (by default this is done with an IP address allow-list) ```elixir {:ok, idp} = Shin.idp("https://idp.university.ac.uk/idp") ``` ## 2. Getting raw metrics information ```elixir {:ok, metrics} = Shin.metrics(idp) ``` ## Producing a simplified report ```elixir {:ok, report} = Shin.report(idp, :system_info) IO.puts report.cores ``` ## Triggering a service reload ```elixir {:ok, message} = Shin.reload_service(idp, "shibboleth.AttributeFilterService") ``` ## Listing a user's attribute data released to an SP ```elixir {:ok, attr_data} = Shin.attributes(idp, "https://test.ukfederation.org.uk/entity", "pete") Shin.Attributes.values(attr_data, "eduPersonEntitlement") ``` ## Viewing a simulated SAML2 assertion containing user attributes ```elixir {:ok, saml_assertion_xml} = Shin.assertion(idp, "https://test.ukfederation.org.uk/entity", "pete") ``` ## Fetching an SP's metadata ```elixir {:ok, metadata_xml} = Shin.metadata(idp, "https://test.ukfederation.org.uk/entity") ```