Git Product home page Git Product logo

saml-integration-utilities's Introduction

SAML-integration-utilities

Branch Status
master Build Status

What it's all about

The aim is to show how to initialize Single Sign-On integration using SAML version 2 standard from Identity Provider to Service Providers (or your web application with authentication mechanisms) using C# .NET 5.0.

How it works and what part of SAML workflow is covered

See my full artile on dev.to to understand full context.

Components

Metadata File Generator

Small application that allows to initialize integration with Service Provider by generating and sending metadata.xml file.

How to use

  1. First of all, you have to buy X.509 certificate (or maybe you already have one) in one of the publicly known vendors. This certificate should include both Private and Public keys and allow you to sign in the documents with it. You should have thumbprint identity of this certificate (find it in the certificate information).

  2. Then, simply run the app and follow the questions by putting your answers:

$> SamlIntegration.MetadataFileGenerator.exe
  1. After file is successfully generated, it will appear in the same Applcation directory.

  2. Provide metadata.xml and Public part of your certificate to the Service Provider.

Saml Integration Utilities class library

A set of utility classes

How to use

  1. Attach library or project to your project

  2. Follow the Service Provider requirements and comment/remove the steps that are not necessary (i.e. sign of Assertion or SAMLResponse documents, encryption of Assertion document).

  3. Attach SamlIntegrationSteps Utilities to your project, so you could use and modify it

  4. Modify list of attributes (Dictionary<string, string>) inside of SamlIntegrationSteps.BuildEncodedSamlResponse() according to the needs of your third-party vendor. Usually, it requires some kind of user identity and user profile information to be passed.

  5. In the client code (see IntegrationClientExample in the Example project) call SamlIntegrationSteps.BuildEncodedSamlResponse() to create SAMLResponse document ready for the authentication HTTP POST request.

  6. Parse HTTP response to find redirect URL and do the redirect, so user will be authenticated on the vendor side.

Follow

Ask questions using contacts shown here Anton Yarkov

Copyright

Copyright © 2021 Anton Yarkov. All rights reserved. Contacts: [email protected]

Licensed under the Apache License, Version 2.0 (the "License you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

saml-integration-utilities's People

Contributors

optiklab avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  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.