Using Google OpenID connect API

Using Google OpenID connect API

Google need to trust in requester application to work with. To do so, you need to access to Google developers console and create and configure a new credential project.

  1. Create Credentials > OAuth Client ID

  2. Application Type: Web Application

  3. Name: Service Provider (SP) name

  4. Let's assume that our server is testkeystone.com and it is configured public in port 5000:

Installing mod_auth_openidc

Keystone works under apache2 and can be combined with different authentication systems provided by Apache modules.

In order to work with OpenID connect, mod_auth_openidc needs to be installed and configured. There are different releases available for different Linux distributions as well as source code to be compiled. All those packages and source code can be found here:

mod_auth_openidc Configuration

Add the following lines (example) to wsgi-keystone configuration file:

  • Ubuntu systems: /etc/apache2/sites-enabled/wsgi-keystone.conf

    • LoadModule auth_openidc_module /usr/lib/apache2/modules/mod_auth_openidc.so

  • Centos/RHEL: /etc/httpd/conf.d/wsgi-keystone.conf

    • After installation of mod_auth_openidc-<VERSION>.el7.centos.x86_64.rpm

      you should have everything properly configure to be used by the apache server:

      /etc/httpd/conf.modules.d/10-auth_openidc.conf

      /usr/lib64/httpd/modules/mod_auth_openidc.so

Inside VirtualHost *:5000:

  • your_Client_ID: Client ID copied from Google developers Console

  • your_secret: Secret copied from Google developers Console

  • passphrase: Whatever

Keystone configuration

Add or modify the following configuration options in /etc/keystone/keystone.conf

Dashboard Configuration

Add or modify the following configuration options in /etc/openstack_dashboard/local_settings:

Create Groups, Projects

For matching Google user to a certain project, you could use one existing or create a new one like this:

Group matching

OpenID connect/Google login needs to be matched with an specific group. Regarding the previous configuration (group ID, type), create the following json file (google_mapping.json), that will be used to create the mappings in the keystone federations:

The next steps are to create the mapping, the identity provder and the federation protocol:

Last updated