handnot2

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 with Samly
  • samly_howto - This is a sample Phoenix application that shows how to use Samly

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

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: GitHub - handnot2/samly: Elixir Plug library to enable SAML 2.0 SP SSO in Phoenix/Plug applications. · GitHub

esaml: GitHub - handnot2/esaml: Erlang SAML library, SSO and SLO, with Cowboy integration · GitHub

Docker based Identity Providers for development purposes:

SimpleSAMLphp: GitHub - handnot2/samly_simplesaml: Docker based SimpleSAMLPhp IDP setup for development purposes. Includes templates for working with Samly Elixir Library enabled SP. · GitHub

Shibboleth: GitHub - handnot2/samly_shibboleth: Shibboleth SAML IdP setup for dev · GitHub

Development Assistance:

Phoenix Application showing Samly usage: GitHub - handnot2/samly_howto: Sample Elixir Phoenix application showing Samly library usage for SSO enablement · GitHub

maennchen

maennchen

Hey everyone,

the EEF CNA just published a CVE for esaml:
https://cna.erlef.org/cves/CVE-2026-28809.html

It’s an XXE issue in the SAML handling that can lead to local file reads and potentially SSRF.

We tried reaching out to the maintainers but unfortunately didn’t get a response, and there’s currently no patch available.

If you’re using this library in production, it’s probably worth taking a closer look. And if someone here is interested in stepping up: this might be a good candidate to take over maintenance (fork, patch, and coordinate with the Hex.pm team to transfer ownership).

If a fix gets released, please let us know so we can update the advisory and mark affected versions correctly:
https://cna.erlef.org/contact

handnot2

handnot2

Created a blog post on using samly. This includes instructions on setting up a self-hosted Shibboleth SAML Identity Provider that uses OpenLDAP.

Where Next?

Popular in Announcing Top

dbern
I’m excited to announce that TaxJar has developed and open-sourced DateTimeParser. We developed it because we found a need to parse user ...
New
mikehostetler
I’m excited to announce Jido, a framework providing foundational primitives for building autonomous agent systems in Elixir. While develo...
New
bryanjos
Hi, I just published version 0.23.0 of Elixirscript. https://github.com/bryanjos/elixirscript/blob/master/CHANGELOG.md Most of the chan...
New
Eiji
ExApi is a library that I’m developing now and hope release soon This library will allow to: list all apis list all api implementation...
New
Qqwy
Hello everyone, I wrote a small library today called MapDiff. It returns a map listing the (smallest amount of) changes to get from map...
New
Azolo
Hey everyone, I just released WebSockex which is a Elixir WebSocket client. WebSockex strives to work as a OTP special process, be RFC6...
New
Flo0807
Hello everyone! I am excited to share our heart project Backpex with you. After building several Phoenix applications, we realized that...
New
hpopp
After just over two years in development, this latest version of Pigeon is what I finally consider done in regards to my original vision ...
New
archan937
It is a well-know topic within the Elixir community: “To mock or not to mock? :)” Every alchemist probably has his / her own opinion con...
New
OvermindDL1
Been making an MLElixir thing (not released yet…) for fun in spare time in the past day. I’m just trying to see how much I can get an ML...
132 14057 106
New

Other popular topics Top

aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
marius95
Hello everyone, I try to use an Javascript Event Handler in my root.html.leex file. Therefore I created a function in the app.js file: ...
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
johnnyicon
Hi all, I’ve just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I’m trying to use Postgres...
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? Ecto.Repo — Ecto v3.14.0 has exampl...
New
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
dogweather
I wrote this comment on r/haskell, and it’s not popular there. :wink: But I think I’m on to something… Haskell reminds me of Java, and e...
New
vegabook
I’m brand new to Phoenix and I have stripped one of the demo applications to the bone. I just want to get an svg up on the screen. Here i...
New

Latest on Elixir Forum

Elixir Forum

We're in Beta

About us Mission Statement