SAML2 sample useCaseDemo
Introduction
This is a sample that illustrates the following use cases in a
circle
of trust having one Identity Provider(IDP, title shown as GreatAir in sample pages,) and one
Service
Provider(SP, title shown as BestCars
in sample pages).
- IDP initiated Single Sign On
- SP initiated Single Sign On
- IDP initiated Single Log out
- SP initiated Single Log out
- IDP initiated Federation
- SP initiated Federation
- IDP initiated Federation Termination
- SP initiated Federation Termination
Installing the sample
The sample is installed if you have specified
DEPLOY_SAMPLES=true
in the saml2silent file used to install and configure in SAML2
plugin
on your system
Prerequisites to use the sample
To run and test the sample
- You should have at least one IDP configured with SAML2 plugin and
at
least one SP configured with SAML2 plugin.
- The meta data of IDP should be registered with SP as a
remote
IDP.
- The meta data of SP should be registered with IDP as a remote SP.
- SP and IDP should belong to the same circle of trust (COT)
- SP and IDP should be running on different installation of SAML2
plugins.
After you have done these, you would be able to run and test out the
sample.
See setting up IDP and SP
for detailed instructions on setting up IDP and SP.
Trying sample use cases
This document assumes IDP SAML2 plugin is configured at
http://idp-host/federation/saml2
and SP SAML2 plugin is configured at
http://sp-host/federation/saml2.
Please correct the URLs used in the following text to reflect
your
installation URLs. By default SAML2 plugin is configured in
Access
Manager to run at http://am-host/amserver/saml2. By default SAML2
plugin
is configured in Federation Manager to run at
http://fm-host/federation/saml2.
IDP initiated SSO and SLO
- Point your browser at
http://idp-host/federation/samples/saml2/useCaseDemo/home.jsp
(useCaseDemo home page at IDP).
- Click on link " Reserve Car with our associate,
BestCars". You would be prompted by IDP to login.
- On successful login at IDP, IDP would initiate Single Sign On and
redirect
you to SP.
- SP would prompt you to login locally if you have not yet
federated
accounts at IDP and SP.
- SP would then automatically log you in based on the Assertion
from
IDP and you would be shown a protected application page by SP.
This completes IDP initiated Single Sign On and Federation.
- Click on the link "BestCars(SP: <sp1>)
Home". You would be taken to
http://sp-host/federation/samples/saml2/useCaseDemo/home.jsp
(useCaseDemo home page at SP). You would see links allowing you
to
Logout, Defederate and a link to take you to home page of
useCaseDemo
at IDP.
- Click on the link " GreatAir(IDP: idp1) Sample Home"
- Your browser would show useCaseDemo sample home page at IDP.
- Click on "Logout" link. IDP would initiate a Single
Log
Out and log you out SP and IDP. You could
verify
that you are logged out by visiting useCaseDemo sample page at IDP and
SP.
The pages would show you "Login" link.
SP initiated SSO and SLO
- Point your browser at
http://sp-host/federation/samples/saml2/useCaseDemo/home.jsp
(useCaseDemo home page at SP).
- Click on link "Reserve Car with us". The link is for
a
protected application page that requires authentication. SP would
initiate Single Singon Request.
- IDP would prompt you to authenticate.
- SP would prompt you to login locally if you have not yet
federated
accounts at IDP and SP.
- SP would then automatically log you in based on the Assertion
from
IDP and you would be shown the protected application page by SP.
- This completes SP initiated Single Sign On and Federation.
- Click on the link "BestCars(SP: <sp1>)
Home". You would be taken to
http://sp-host/federation/samples/saml2/useCaseDemo/home.jsp
(useCaseDemo home page at SP).
- You would see links allowing you to Logout, Defederate and
a
link to take you to home page of useCaseDemo at IDP.
- Click on "Logout" link. SP would initiate a Single
Log
Out and log you out SP and IDP. You could
verify
that you are logged out by visiting useCaseDemo home page at IDP and
SP.
The pages would show you "Login" link.
IDP Initiated Federation and Defederation
- Point your browser at
http://idp-host/federation/samples/saml2/useCaseDemo/home.jsp
(useCaseDemo home page at IDP).
- Click on link Login. IDP would prompt you for local login.
On
completion of login, IDP would show you useCaseDemo home page at IDP.
- If you have already federated with SP, the page would show the
link.
"Terminate Federation with BestCars". Click on the link.
- IDP would initiate a defederate request. On completion of
defederation, you would be shown the useCaseDemo sample home page at
IDP. You would be shown
a link " Federate with BestCars". You can verify that you are
really
defederated by visiting useCaseDemo home page at SP. SP
should
also would show you the link Federate with GreatAir.
- Point your browser at
http://idp-host/federation/samples/saml2/useCaseDemo/home.jsp
(useCaseDemo home page at IDP).
- Click on link " Federate with BestCars"
- IDP would initiate Single Sign On and Federate request. On
completion
of federation, you would be shown useCaseDemo sample home page at IDP
again.
You would be shown a link " Terminate Federation with BestCars".
You
can verify that you are really federated by visiting useCaseDemo
home
page at SP. SP would show you Terminate Federation with
GreatAir.
- SP would initiate Single Sign On. On completion of Single Sign
On,
useCaseDemo sample home page would be shown again.
SP Initiated Federation and Defederation
- Point your browser at
http://sp-host/federation/samples/saml2/useCaseDemo/home.jsp
(useCaseDemo sample home page at SP).
- Click on link " Login, secure service provided by GreatAir"
- SP would initiate Single Sign On. On completion of Single Sign
On,
useCaseDemo sample home page would be shown again at SP.
- Click on link " Terminate Federation with GreatAir".
SP
would initiate a defederate request. On completion of
defederation, you would be shown the useCaseDemo sample home page at
SP. You would be shown
a link " Federate with GreatAir". You can verify that you are
really
defederated by visiting useCaseDemo sample home page at IDP. IDP
would
show you Federate with BestCars.
- Point your browser at
http://sp-host/federation/samples/saml2/useCaseDemo/home.jsp
(useCaseDemo home page at SP).
- Click on link "Federate with GreatAir".
- SP would initiate Single Sign On and Federate request. On
completion
of federation, you would be shown useCaseDemo sample home page at SP
again.
You would be shown a link " Terminate Federation with GreatAir".
You
can verify that you are really federated by visiting useCaseDemo
home
page at IDP. IDP would show you Terminate Federation with
BestCars.
Setting up IDP and
SP
to try out useCaseDemo sample
Install SAML2 at IDP, create and load meta data
Install SAML2 plugin at IDP http://idp-host/federation/saml2.
Create metaFile and extended metaFile at IDP. Let us call them
idp1Meta.xml
and idp1MetaX.xml respectively, using the command
<opt/SUNWam/saml2/bin>saml2meta -i <staging dir> template
-u <userdn> -w <password> -e <entityID> -d
<idpMetaAlias>
-m idp1Meta.xml -x idp1MetaX.xml
(-i option is required only for SAML2 installed in FM)
Edit idp1MetaX.xml and replace
<Attribute name="cotlist">
<Value></Value>
</Attribute>
With
<Attribute name="cotlist">
<Value>samplecot</Value>
</Attribute>
This is required to add IDP to the circle of trust (COT),
"samplecot". COT, "samplecot" is automatically created by
SAML2 plugin installer.
Import the meta files into IDP, using the command
<opt/SUNWam/saml2/bin>saml2meta -i <staging dir> import -u
<userdn>
-w <password> -m idp1Meta.xml -x idp1MetaX.xml
(-i option is required only for SAML2 installed in FM)
Install SAML2 at SP, create and load meta data
Install SAML2 plugin at SP http://sp-host/federation/saml2.
Create metaFile and extended metaFile at SP. Let us call them
sp1Meta.xml
and sp1MetaX.xml respectively, using the command
<opt/SUNWam/saml2/bin>saml2meta -i <staging dir> template
-u
<userdn> -w <password> -e <entityID> -s
<spMetaAlias>
-m sp1Meta.xml -x sp1MetaX.xml
(-i option is required only for SAML2 installed in FM)
Edit sp1MetaX.xml and replace
<Attribute name="cotlist">
<Value></Value>
</Attribute>
With
<Attribute name="cotlist">
<Value>samplecot</Value>
</Attribute>
This is required to add SP to the circle of trust (COT),
"samplecot". COT, "samplecot" is automatically created by
SAML2 plugin installer.
Import meta files into SP.
<opt/SUNWam/saml2/bin>saml2meta -i <staging dir> import -u
<userdn>
-w <password> -m sp1Meta.xml -x sp1MetaX.xml
(-i option is required only for SAML2 installed in FM)
Register SP meta data with IDP
Get sp1Meta.xml and sp1MetaX.xml to a directory at IDP.
Modify sp1MetaX.xml and set attribute hosted="0" for EntityConfig
element.
Import SP meta xml files into IDP.
<opt/SUNWam/saml2/bin>saml2meta -i <staging dir> import -u
<userdn>
-w <password> -m sp1Meta.xml -x sp1MetaX.xml
(-i option is required only for SAML2 installed in FM)
Add SP to COT "samplecot" at IDP
<opt/SUNWam/saml2/bin>saml2meta -i <staging dir> cotadd -u
<userdn> -w <password> -t samplecot -e <SP EntityID>
(-i option is required only for SAML2 installed in FM)
Register IDP meta data with SP
Get idp1Meta.xml and idp1MetaX.xml to a directory at SP.
Modify idp1MetaX.xml and set and set attribute hosted="0" for
EntityConfig
element.
Import IDP meta xml files into SP.
<opt/SUNWam/saml2/bin>saml2meta -i <staging dir> import -u
<userdn>
-w <password> -m idp1Meta.xml -x idp1MetaX.xml
(-i option is required only for SAML2 installed in FM)
Add IDP to COT "samplecot" at SP
<opt/SUNWam/saml2/bin>saml2meta -i <staging dir> cotadd -u
<userdn> -w <password> -t samplecot -e <IDP EntityID>
(-i option is required only for SAML2 installed in FM)
Select SAML2 Authentication Module in Authentication Core Service
This needs to be done only for SAML2 installed as SP on FM.
Login(local login) to FM as top level administrator(amadmin).
Navigate to Organization > Authentication > Core : Edit
Select SAML2 in Organization Authentication Modules choice list
Save