samly v0.6.2 Samly.Provider View Source

SAML 2.0 Service Provider

This should be added to the hosting Phoenix/Plug application’s supervision tree. This GenServer initializes the SP configuration and loads the IDP medata XML containing information on how to communicate with the IDP.

# application.ex

  children = [
    # ...
    worker(Samly.Provider, []),
  ]

The configuration parameters are honored in the following order: Application.get_env, environment variables and finally hard defaultds.

The configuration information needed for Samly can be specified as shown here:

# config/dev.exs

config :samly, Samly.Provider,
  base_url: "http://samly.howto:4003/sso",
  #pre_session_create_pipeline: MySamlyPipeline,
  certfile: "path/to/service/provider/certificate/file",
  keyfile: "path/to/corresponding/private/key/file",
  idp_metadata_file: "path/to/idp/metadata/xml/file"

Samly relies on environment variables for parameters missing from configuration.

VariableDescription
SAMLY_CERTFILEPath to the X509 certificate file. Defaults to samly.crt
SAMLY_KEYFILEPath to the private key for the certificate. Defaults to samly.pem
SAMLY_IDP_METADATA_FILEPath to the SAML IDP metadata XML file. Defaults to idp_metadata.xml
SAMLY_BASE_URLSet this to the base URL for your application (include /sso)