Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SAML simple example for beginners

I am beginner to the SAML v2.0 technology and I get the theory knowledge but I didn't find any examples on Google. Can anybody provide me with a step by step example for simple "SAML for v2.0".

  1. Upto now I've gone through the theory part,i.e.., it support Single sign on and
    also I understood about the Service provider and Identity Provider .
  2. Presently I am working on Linux Environment
  3. I need basic example in step by step manner how the request is moving from user -> Identity Provider->Service Provider and how to configure the environment .
  4. Is it possible to execute the example for the SAML v2.0
  5. Is their any chance to execute SAML example in Java language,If it possible you can
    provide the example on Java also.
like image 393
user2779075 Avatar asked Sep 14 '13 11:09

user2779075


People also ask

What is SAML with example?

SAML ExampleSAML uses a claims-based authentication workflow. First, when a user tries to access a site, the service provider asks the identity provider to authenticate the user. Then, the service provider uses the SAML assertion issued by the identity provider to grant the user access.

What is simple SAML?

SimpleSAMLphp is an award-winning application written in native PHP that deals with authentication. The community-led project has a large user base, a helpful user community and a large set of external contributors. The main focus of SimpleSAMLphp is providing support for: SAML 2.0 as a Service Provider (SP)

Is SAML the same as SSO?

SAML enables Single-Sign On (SSO), a term that means users can log in once, and those same credentials can be reused to log into other service providers.


1 Answers

Typical SSO with SAML is something called Web SSO Profile. There are many products supporting this on the market for example OpenAM, Shibboleth, OpenSAML and Oracle Identity Federation. The specific configuration is dependant on what product you choose to use. A working example of OpenSAML that I use in my book is availible here.

On a SAML level, the SP and IDP exchanges Metadata which contain configuration information on how the SP and IDP want to communicate.

SSO is then done in four steps:

  1. SP sees that the user does not have an authenticated session.
  2. The SP redirects the user to IDP with a SAML AutnRequest as an URL parameter.
  3. The IDP authenticates the user and redirects it back to the SP with an artifact in URL parameter.
  4. The SP exchanges the Artifact for an Assertion over SOAP using a ArtifactResolveRequest to the IDP.

If you want to code this yourself in Java, you can use OpenSAML. On my blog I have many examples on how to use it.

In my book, A Guide To OpenSAML, I write alot about this

EDIT New edition of the book is out, covering OpenSAML v3

like image 130
Stefan Rasmusson Avatar answered Sep 20 '22 11:09

Stefan Rasmusson