handnot2
Samly - Add SAML SSO to your Phoenix application (now with multiple identity provider support)
Samly can be used to enable SAML 2.0 Single Sign On in a Plug/Phoenix application.
This library uses Erlang esaml to provide
plug enabled routes. Use of esaml provides the following capabilities:
- SP initiated login
- SP initiated logout
- IdP initiated logout
This is tested with SimpleSAMLphp. There is a fairly detailed README.md file to help you get started. There are two companion Repos:
-
samly_simplesaml- Use this to create your own SAML IdP for development purpose when working withSamly -
samly_howto- This is a sample Phoenix application that shows how to useSamly
The readme file has an FAQ section that covers the following:
- How to setup a SAML 2.0 IdP for development purposes
- Sample Phoenix application that shows how to use Samly
- How to register the service provider with IdP
- How to enable Samly in my application
Feedback and contributions are appreciated.
Most Liked
handnot2
Samly v1.0.0 Released!
Samly is a Plug library that can be used to enable SAML Single-Sign-On authentication in Phoenix applications. It makes use of the esaml library for core SAML request/response handling.
This has been used successfuly to work with the following Identity Providers:
-
Okta
-
Ping Identity
-
OneLogin
-
ADFS
-
Nexus GO
-
Shibboleth
-
SimpleSAMLphp
Hopefully, this library provides some help in successful adoption of Elixir in Enterprise/Intranet.
Many thanks to the following contributors (samly and esaml):
Many others also contributed by using this library, opening Github issues and providing feedback in DM. Please continue to open issues and submit PRs to improve Samly further. Also, share your experience in getting Samly to work with your IdP so others in the community can benefit as well.
Repos:
Samly: https://github.com/handnot2/samly
esaml: https://github.com/handnot2/esaml
Docker based Identity Providers for development purposes:
SimpleSAMLphp: https://github.com/handnot2/samly_simplesaml
Shibboleth: https://github.com/handnot2/samly_shibboleth
Development Assistance:
Phoenix Application showing Samly usage: https://github.com/handnot2/samly_howto
handnot2
Created a blog post on using samly. This includes instructions on setting up a self-hosted Shibboleth SAML Identity Provider that uses OpenLDAP.
handnot2
Samly library version v0.8.0 introduces support for working with multiple Identity Providers (earlier versions were limited to working with only one IdP).
There are two companion Repos:
-
samly_simplesaml- Docker based self-hosted SimpleSAMLPhp Identity provider for development purposes -
samly_howto- A simple Phoenix application that demonstrates how to SAML enable your application. This will show the SAML assertions from the IdP upon success end-user authentication. It is mostly pre-configured to work withsamly_simplesaml. But you can change the configuration to point to any SAML provider.
The Samly documentation has been updated as well.
handnot2
Samly v0.8.4 and esaml v3.3.0
Now works with Shibboleth IdP (in addition to SimpleSAMLPhp). Here are some screenshots showing the login and consent flows interacting with a self-hosted Shibboleth IdP setup.
Login portion in a Samly enabled phoenix app

Shibboleth Login Page
Shibboleth Consent Page
Back to the Phoenix app - Showing the SAML assertion Attributes
Nezteb
For what it’s worth, I’m aware of two active forks of both esaml and samly:










