I setup the keystone to keystone federation with two devstacks. Please pay attention that this guide is based on devstack which assumes keystone is running under Apache already.
Use SAML2 as the federation protocol.
It only works in CLI. No horizon SSO enabled in this guide right now.
Software Versions
Software
Version
Description
OS
Ubuntu 14.04.3 LTS
libapache2-mod-shib2
2.5.2+dfsg-2
Federated web single sign-on system (Apache module)
liblog4shib1:amd64
1.0.8-1
log4j-style configurable logging library for C++ (runtime)
libshibsp6:amd64
2.5.2+dfsg-2
Federated web single sign-on system (runtime)
shibboleth-sp2-schemas
2.5.2+dfsg-2
Federated web single sign-on system (schemas)
xmlsec1
1.2.18-2ubuntu1
XML security command line processor
libxmlsec1
1.2.18-2ubuntu1
XML security library
libxmlsec1-openssl
1.2.18-2ubuntu1
Openssl engine for the XML security library
Keystone as a Service Provider (SP)
Finish the following configuration in SP:172.16.40.112.
After the configuration, the total changes in my /etc is shown below.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
ubuntu@shuquan-devstack-sp:/etc$ sudo git status
On branch master
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)(use "git checkout -- <file>..." to discard changes in working directory)
modified: apache2/sites-available/keystone.conf
modified: keystone/keystone.conf
modified: shibboleth/attribute-map.xml
modified: shibboleth/shibboleth2.xml
Untracked files:
(use "git add <file>..." to include in what will be committed)
shibboleth/sp-cert.pem
shibboleth/sp-key.pem
no changes added to commit (use "git add" and/or "git commit -a")
Setup Shibboleth
Just follow the instruction of the official docs and nothing special. :) My changes are shown below.
/etc/shibboleth/shibboleth2.xml
/etc/shibboleth/attribute-map.xml
/etc/apache2/sites-available/keystone.conf
Configure Federation in Keystone
Please pay attention to idp_entity_id. It has to be identical in SP & IdP. You will use it when you config the Identity Provider in Keystone’s [saml]/idp_entity_id option in IdP.
idp_entity_id is the unique identifier for the Identity Provider in Keystone’s [saml]/idp_entity_id option in IdP. This value should be the same in SSO entityID in /etc/shibboleth/shibboleth2.xml and use this command
Add Identity Provider(s), Mapping(s), and Protocol(s)
Note: The name you give the protocol is not arbitrary. It must match the method name you gave in the [auth]/methods config option. When authenticating it will be referred to as the protocol_id.
Keystone as an Identity Provider (IdP)
Finish the following configuration in IdP:172.16.40.115.
After the configuration, the total changes in my /etc is shown below.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
ubuntu@shuquan-devstack-idp:/etc$ sudo git status
On branch master
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)(use "git checkout -- <file>..." to discard changes in working directory)
modified: apache2/sites-available/default-ssl.conf
modified: apache2/sites-available/keystone.conf
modified: keystone/keystone.conf
Untracked files:
(use "git add <file>..." to include in what will be committed)
keystone/saml2_idp_metadata.xml
keystone/ssl/
no changes added to commit (use "git add" and/or "git commit -a")
Package Installation
The only package need to install is xmlsec1.
1
$ apt-get install xmlsec1
Configure Federation in Keystone
1.Enable IdP is easier because you don’t need to deal with Shibboleth. Before following the official documentation, you should generate a self-signed cert-key pair for signing in the future and configure it properly in keystone and apache configure file.
2.Generate Metadata.To create metadata for your keystone IdP, run the keystone-manage command and redirect the output to a file. For example:
3.Please pay attention to the SP creation. I made a mistake here and spent some time on debugging. The key is that you don’t need to use entityID of shibboleth2.xml in SP for –service-provider-url setting. http://172.16.40.112/Shibboleth.sso/SAML2/ECP is fine because IdP will send SAML assertion to this link and the entityID may not resolve to anything. Surely, you can set these two value identical.