Code Monkey home page Code Monkey logo

saml2's Introduction

SimpleSAMLphp SAML2 library

Build Status Coverage Status

A PHP library for SAML2 related functionality. Extracted from SimpleSAMLphp, used by OpenConext. This library started as a collaboration between UNINETT and SURFnet but everyone is invited to contribute.

Before you use it

DO NOT USE THIS LIBRARY UNLESS YOU ARE INTIMATELY FAMILIAR WITH THE SAML2 SPECIFICATION.

If you are not familiar with the SAML2 specification and are simply looking to connect your application using SAML2, you should probably use SimpleSAMLphp.

Note that the HTTP Artifact Binding and SOAP client do not work outside of SimpleSAMLphp.

Which version to pick?

The latest released version (4.x range) is the preffered version. The 3.x branch is our LTS branch and will be supported as long as SimpleSAMLphp hasn't migrated to the 4.x branch.

All other branches (2.x and earlier) are no longer supported and will not receive any maintenance or (security) fixes. Do not use these versions.

We conform to Semantic Versioning. Be sure to check the UPGRADING.md file if you are upgrading from an older version. Here you will find instructions on how to deal with BC breaking changes between versions.

Usage

  • Install with Composer, run the following command in your project:
composer require simplesamlphp/saml2:^3.0
  • Provide the required external dependencies by extending and implementing the SAML2\Compat\AbstractContainer then injecting it in the ContainerSingleton (see example below).

  • Make sure you've read the security section below.

  • Use at will. Example:

    // Use Composers autoloading
    require 'vendor/autoload.php';

    // Implement the Container interface (out of scope for example)
    require 'container.php';
    SAML2\Compat\ContainerSingleton::setContainer($container);

    // Set up an AuthnRequest
    $request = new SAML2\AuthnRequest();
    $request->setId($container->generateId());
    $request->setIssuer('https://sp.example.edu');
    $request->setDestination('https://idp.example.edu');

    // Send it off using the HTTP-Redirect binding
    $binding = new SAML2\HTTPRedirect();
    $binding->send($request);

Security

  • Should you need to create a DOMDocument instance, use the SAML2\DOMDocumentFactory to create DOMDocuments from either a string (SAML2\DOMDocumentFactory::fromString($theXmlAsString)), a file (SAML2\DOMDocumentFactory::fromFile($pathToTheFile)) or just a new instance (SAML2\DOMDocumentFactory::create()). This in order to protect yourself against the XXE Processing Vulnerability, as well as XML Entity Expansion attacks

License

This library is licensed under the LGPL license version 2.1. For more details see LICENSE.

saml2's People

Contributors

andreassolberg avatar artem-tim avatar bjorpe avatar br00k avatar brianv avatar cb8 avatar drvanr avatar falco76 avatar ghalse avatar jaimeperez avatar jas4711 avatar jbaron-gingco avatar lon avatar madmatt avatar mkodde avatar mshikaji avatar olavmo-sikt avatar olavmrk avatar peter- avatar pradtke avatar relaxnow avatar scalrow avatar soyunalavadora avatar tamlyn avatar tbenr avatar tdiscuit avatar thijskh avatar timwienk avatar trejjam avatar tvdijen avatar

Watchers

 avatar  avatar

Forkers

dub357

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.