OmniAuth Google OAuth2 strategy – where to get Google Key and Secret

Having spent too much time ironically on Google searching for how to obtain a Google Key and Google Secret (for OAuth2) I decided to post this for future reference.

I’m assuming that you are implementing some Google authentication functionality with something like OmniAuth (Ruby on Rails gem).  Whether it is OmniAuth or not you’ll need to register your application with Google; obtaining a Google Key and Google Secret as well as setting a callback url.

  1. Go to https://code.google.com/apis/console, log in with your Google account and click on API Access.
  2. Create OAuth2 credentials by clicking the big blue OAuth2 button.
  3. Set the callback url and the name of your app (can be edited later)
  4. The Google Key (as it is referred to by OmniAuth) is the Client ID
  5. The Google Secret (as it is referred to by OmniAuth) is the Client Secret
  6. Use those credentials as per your documentation for implementing OAuth2 authentication.

The Google OmniAuth strategy for OAuth2 is here: https://github.com/zquestz/omniauth-google-oauth2.  Look in the examples folder for details on the rest of the implementation.

Advertisements

2 Responses to OmniAuth Google OAuth2 strategy – where to get Google Key and Secret

  1. Iain Barnett says:

    Thanks for this, much appreciated – I was scratching my head trying to work out which of the settings was the Google Key!

  2. dooker says:

    Thanks! This helped a lot :]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: