Code Monkey home page Code Monkey logo

laravel-saml-demo's Introduction

Saml Laravel Demo

This is a demo of saml login using Laravel Framework


Requirements Php 5.4+


I/ Saml login using 3rd party Service Provider

Prepare:


II/ Saml login using simplsamlphp library as SP

+Create account on ssocircle.com

+Download simplesamlphp

Simplesamlphp source package has 2 parts:

  • Service provide: located at www directory of source package
  • The library

Installation

1/Setup SP

  • Move Service provider part to public directory of laravel project

Do some config at app/library/saml/config to configure Service Provider

  • config.php:

     'baseurlpath' => 'www/' //location of SP folder
     ...
     'auth.adminpassword' => 'your password admin here',
    

Do some config at app/config to declare your Identity Provider

  • saml-authsources.php:

        'default-sp' => array(
              'saml:SP',
              'entityID' => 'samlsample' ,
              'idp' => 'http://idp.ssocircle.com',
              'discoURL' => null,
              'certificate' => 'sample.crt', 
           )
    
  • saml-metadata.php: Contains an associated array of IDPs

      'http://idp.ssocircle.com' => array(
            'name' => array(
                'en' => 'Circle SSO',
            ),
            'description'          => '',
            //ssocircle login url
            'SingleSignOnService'  => 'https://idp.ssocircle.com:443/sso/SSORedirect/metaAlias/ssocircle',
            //ssocircle logout url
            'SingleLogoutService'  => 'https://idp.ssocircle.com:443/sso/IDPSloRedirect/metaAlias/ssocircle',
            // fingerprint of ssocircle certificate
    
            'SingleSignOnIdpInitUrl' => 'https://idp.ssocircle.com/sso/idpssoinit?metaAlias=/ssocircle&spEntityID=samlsample',
    
            'certFingerprint'      => '9F:08:98:77:0D:9F:09:48:C4:5B:F5:D6:DB:55:CB:03:7C:3B:28:0C',
        )
    

These configs get from soocircle metadata located at http://idp.ssocircle.com/ . The certFingerptint get by following command line:

 openssl x509 -noout -in ssocircle.pem -fingerprint

with ssocircle.pem is the certificate file created by X509Certificate section in ssocircle metadata xml file

Test

To check if your SP work well, visit this url: http://YOUR_DOMAIN/www/index.php

Your metadata stays here: http://YOUR_DOMAIN/www/module.php/saml/sp/metadata.php/default-sp?output=xhtml

2/Setup IDP (ssocircle):

Login to ssocircle.com . Click on Manage metadata link on the left. fill infomation and save.

You can test if your SP is work well with IDP by visiting this URL: http://YOUR_DOMAIN/www/module.php/core/authenticate.php

laravel-saml-demo's People

Contributors

trongkhanh89 avatar khoadp avatar

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.