# OIDC — Google IdP tutorial
Tutorial for configuring a Google OpenID Connect client, required to enable the login method with a Google account.
# Prerequisites
- An already deployed Onezone instance — see here for instructions.
- Access to a Google account.
# Procedure
Login to Google https://accounts.google.com (opens new window).
Open https://search.google.com/search-console (opens new window) and add the Onezone service domain. You will find the link in the left upper corner.
Copy and save the Google verification token.
Place a static DNS TXT record with the token in the
overlay.config
. For adocker-compose
deployment, you will find it atdata/persistence/configs/overlay.config
:[ {oz_worker, [ % preexisting entries ... {dns_static_txt_records, [ {<<>>, <<"google-site-verification=abcdefgh123456789QWERTYUIASDFG-ZXCVBNqwerty">>} ]} ]} ].
NOTE
Make sure the config file is mounted in the Onezone container.
Restart Onezone for the new config to be picked up.
When Onezone is ready, click Verify in the Google UI.
Open https://console.developers.google.com (opens new window)
Create a new project or switch to an existing one.
Add your domain: API → domain verification → add domain → enter domain → add domain.
Configure the consent screen: API- → OAuth consent screen → external → create → fill(application name, logo, email, authorized domain) → Save.
Create credentials: API → Credentials → CREATE CREDENTIALS → OAuth Client ID → Web Application → fill(name: "onedata", Authorized JavaScript origins:
https://example.com
, Authorized redirect URIs:https://example.com/validate_login
) → Create.Place the credentials (client ID and secret) in
auth.config
(see here for more datails). For example:{google, #{ % Configuration of the login page button displayName => "Google", iconPath => "/assets/images/auth-providers/google.svg", iconBackgroundColor => "#F1514F", % Which protocol is used for this IdP protocol => openid, % Configuration specific for OpenID protocol - overrides the default protocolConfig => #{ plugin => default_oidc_plugin, pluginConfig => #{ clientId => "123-qwertyuiopasdfghjkl1234567890zxc.apps.googleusercontent.com", clientSecret => "ZXCVBNMasdfghjkl1234567-", endpoints => #{ xrds => "https://accounts.google.com/.well-known/openid-configuration" } } } }},
Restart Onezone.
$ sudo systemctl restart onezone