IdP initiated SSO and Identity Federation with OpenAM and SAML - part II
- Basic concepts & use case overview
- Sample environment configuration with OpenAM
- Using OpenAM SAML services
- Detailed look at SAML interactions
Sample environment configuration with OpenAM
Now that you know what we will try to achieve in this tutorial let's try to configure our test environment.Prerequisites
Web containersOur test environment will consists of 2 instances of OpenAM, each protecting one web application. The first instance will act as an Identity Provider (IdP) and the second as a Service Provider (SP). This gives us 4 web containers (I used Tomcats 6.x) that I've installed on a single machine using different ports :
- 8010 - tomcat hosting sample ProviderDashboard application
- 8020 - tomcat hosting sample IssueReporter application
- 8080 - tomcat hosting OpenAM protecting ProviderDashboard and acting as IdP
- 8090 - tomcat hosting OpenAM protecting IssueReporter and acting as SP
In this tutorial I assume you already have all those tomcats prepared. This means you have some sample applications deployed that represent ProviderDashboard and IssueReporter web applications. Those webapps should also be protected by OpenAM agents communicating with appropriate OpenAM instance. However, at this stage there is no SSO or identity federation configured for those instances (that is what we need to do).If you don't know how to deploy OpenAM please reffer to the following guide: How to deploy OpenAM.
For now, as ProviderDashboard and IssueReporter you can use any Hello World wabapp. When configuring OpenAM agents please create a realm called "test", as this is what we'll be using in this tutorial.
In your OpenAM instances you should also have registered users, that we use in our use case. This means in IdP OpenAm you should have a user "12345" and in SP there should be a user "filip".
Hosts
My hosts file has 4 different host names set all pointing to 127.0.0.1, so I can access all of the tomcats using different hosts names. The following table summarizes urls I use in this tutorial:
App Url | Openam Url | Description |
---|---|---|
http://www.dashboard.idp.com:8010/providerdashboard | http://www.idp.com:8080/openam | ProviderDashboard application and OpenAM instance protecting it |
http://www.reporter.sp.com:8020/issuereporter | http://www.sp.com:8090/openam | IssueReporter application and OpenAM instance protecting it |
If you are using Windows you can configure those hosts by adding the following line to the file
C:\Windows\System32\drivers\etc\hosts
1
| 127.0.0.1 www.dashboard.idp.com www.reporter.sp.com www.idp.com www.sp.com |
Hosted Identity Provider
First, we will start by configuring hosted Idp in ProviderDashboard OpenAM- Navigate to http://www.idp.com:8080/openam
- Login as amadmin to OpenAM web console
- On the main screen (“Common tasks” tab) choose “Create Hosted Identity Provider” link from “Create SAMLv2 Providers” section
- The following form appears:
- Populate the form:
- Realm
Select the 'test' realm. Each IdP is directly related to a Realm. - Name – unique name of your IdP
You can use OpenAM instance url as the name assuming you will only have 1 IdP per instance. If you want to have more IdPs per OpenAM instance use realm names - Signing key
If you want to digitally sign all your SAML messages select a signing key. OpenAM offers a test key to be used for testing purposes. For production needs you’ll have to generate a new one. - Circle of trust
Provide name for your circle of trust. All SAML providers that want to communicate with each other need to belong to the same circle of trust. - Attribute mapping
If IdP and SP identity stores have different schema but store the same kind of information you can define an explicit mapping between them. E.g. Email address can be stored in IdP as ‘email’ and in SP as ‘mailAddress’. OpenAM suggest you attributes available for your IdP.
- Realm
- Click ‘Configure’ button
- On the confirmation screen click ‘Finish’
Remote Identity Provider
Next, we will register IdP created in previous step as a remote IdP in IssueReporter OpenAM:- Navigate to http://www.sp.com:8090/openam
- Login as amadmin to SP OpenAM web console
- On the main screen (“Common tasks” tab) choose “Register Remote Identity Provider” link from “Create SAMLv2 Providers” section
- Populate the form:
- Url of metadata
Use the following format: http://<idp-openam-url>/saml2/jsp/exportmetadata.jsp - Circle of Trust
Provide the same name as used on IdP side
- Url of metadata
- Click ‘Configure’ button
Hosted Service Provider
Now, it is time to configure an SP hosted in IssueReportr OpenAM:- Navigate to http://www.sp.com:8090/openam
- Login as amadmin to SP OpenAM web console
- On the main screen (“Common tasks” tab) choose “Create Hosted Service Provider” link from “Create SAMLv2 Providers” section
- Populate the form:
- Name – use url of this SP OpenAM instance
- Circle of Trust – select the same one as for IdP
- Use default attribute mapping from Identity Provider - checked
- Click ‘Configure’ button
Remote Service Provider
Next, we will register remote SP in ProviderDashboard OpenAM- Navigate to http://www.idp.com:8080/openam
- Login as amadmin to OpenAM web console
- On the main screen (“Common tasks” tab) choose “Register Remote Service Provider” link from “Create SAMLv2 Providers” section
- The following form appears:
- Populate the form:
- Realm
Select the same realm as for IdP. - Url of metadata
If another instance of OpenAM is used as SP then the url pointing to the service metadata has following format: http://<sp-openam-url>/saml2/jsp/exportmetadata.jsp
In our case it is: http://www.sp.com:8090/openam/saml2/jsp/exportmetadata.jsp - Circle of trust
Select the same as used for IdP - Attribute mapping
If required use the same mappings as in IdP
- Realm
- Click ‘Configure’ button
General configuration
You can always edit providers defined in previous steps. To do that:- Navigate to either SP or IdP OpenAM and login as admin to OpenAM web console
- Click on ‘Federation’ tab
- You should see the screen listing all defined circles of trust and all entities (IdPs and SPs). Sample sreen for IdP OpenAM instance:
- Click on the entity you’d like to update e.g. hosted IdP
- You will be redirected to the screen where you can update default and advanced entity configuration
Environment setup validation
At this stage our test environment should be ready to perform SAML Identity Federation and Single Sign On between our sample ProviderDashboard and IssueReporter applications. In order to validate the setup perform following steps:- Navigate to http://www.idp.com:8080/openam
- Login as amadmin to OpenAM web console
- On the main screen (“Common tasks” tab) choose “Test Federation Connectivity”
- Select circle of Trust (COT) that you'd like to test
- The following screen should appear:
- A warning will be displayed that the user will be logged out - click 'OK'
- Now the actual test begins. It consists of following steps:
- Authentication for Identity Provider, http://www.idp.com:8080/openam
- Authentication for Service Provider. http://www.sp.com:8090/openam
- Testing for the ability to link account
- Testing for single logout
- Testing Single Sign On.
- Testing for account termination
Previous chapter: Basic concepts & use case overview
Next chapter: Using OpenAM SAML services
Tidak ada komentar:
Posting Komentar