Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Samael
This is a SAML2 library for rust.
This is a work in progress. Pull Requests are welcome.
Current Features:
- Serializing and Deserializing SAML messages
- IDP-initiated SSO
- SP-initiated SSO Redirect-POST binding
- Helpers for validating SAML assertions
- Encrypted assertions only support:
- key info:
http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p
http://www.w3.org/2001/04/xmlenc#rsa-1_5
- value info:
http://www.w3.org/2001/04/xmlenc#aes128-cbc
http://www.w3.org/2009/xmlenc11#aes128-gcm
- key info:
- Encrypted assertions only support:
- Verify SAMLRequest (AuthnRequest) message signatures
- Create signed SAMLResponse (Response) messages
The "xmlsec"
feature flag adds basic support for verifying and signing SAML messages. We're using a modified copy of rust-xmlsec library (bindings to xmlsec1 library).
If you want to use the "xmlsec"
feature, you'll need to install the following C libs:
- libiconv
- libtool
- libxml2
- libxslt
- libclang
- openssl
- pkg-config
- xmlsec1
Build instructions
We use nix to faciliate reproducible builds of samael
.
It will ensure you have the required libraries installed in a way that won't cause any issues with the rest of your system.
If you want to take advantage of this, you'll need to put in a little bit of work.
- Install nix
- Install direnv and cachix
# Add ~/.nix-profile/bin to your path first nix profile install nixpkgs#direnv nix profile install nixpkgs#cachix
- Run
cachix use nix-community
to enable a binary cache for the rust toolchain (otherwise you'll build the rust toolchain from scratch) cd
into this repo and rundirenv allow
andnix-direnv-reload
- Install the direnv VS Code extension
Building the library
Just run nix build
Entering a dev environment
If you followed the above instructions, just cd
-ing into the directory will setup a reproducible dev environment,
but if you don't want to install direnv
, then just run nix develop
.
From their you can build as normal:
How do I use this library?
You'll need these dependencies for this example
[]
= { = "1.28.1", = ["full"] }
= { = "0.0.12", = ["xmlsec"] }
= "0.3.5"
= "0.11.18"
= "0.10.52"
= "0.1.5"
Here is some sample code using this library:
use ;
use ServiceProviderBuilder;
use HashMap;
use fs;
use Filter;
async