Giter VIP home page Giter VIP logo

omniauth-google's Introduction

omniauth-google

A Google OAuth strategy for OmniAuth 1.0.

Installing

Add to your Gemfile:

gem 'omniauth-google'

Then bundle install.

Usage

Add the middleware to a Rails app in config/initializers/omniauth.rb:

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :google, CONSUMER_KEY, CONSUMER_SECRET
end

Acknowledgments

This code was extracted from OmniAuth v0.3 and is really the work of those folks!

Contributing to omniauth-google

  • Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
  • Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
  • Fork the project
  • Start a feature/bugfix branch
  • Commit and push until you are happy with your contribution
  • Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
  • Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.

Copyright

Copyright (c) 2011 Yesware, Inc. See LICENSE.txt for further details.

omniauth-google's People

Contributors

mjb-yesware avatar tarko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

omniauth-google's Issues

info missing

i want to know how to get the access token after routing the call back url

The action 'google' could not be found for Users::OmniauthCallbacksController

Hi ,

i'm using omniauth-google for login with gmail. It is give me an error action "google" couldn't be found. while i have define it in "Users::OmniauthCallbacksController" like below.

     def google

     end

this code in my route file

devise_for :users, :controllers => {
:omniauth_callbacks => "users/omniauth_callbacks"

}

what is the problem i don't understand?

Please help

link sign in with google go here "localhost:3000/users/auth/google". Then i have grant access like this in screenshot.

Screenshot from 2013-04-14 10:10:01

But not working.

Dynamic providers error, client_id not found

Hi,
Currently I'm working with dynamic providers (https://github.com/intridea/omniauth/wiki/Dynamic-Providers), but i get a:

400 Bad Request

This is my omniauth.rb:

Rails.application.config.middleware.use OmniAuth::Builder do
 provider :facebook, :setup => true
 provider :twitter,:setup => true
 provider :linkedin,:setup => true
 provider :foursquare, :setup => true 
 provider :google, :setup => true
end

This is my setup method:

def setup_google
 request.env['omniauth.strategy'].options[:client_id] = @site.google_client_id
 request.env['omniauth.strategy'].options[:client_secret] = @site.google_client_secret

 render :text => "Setup complete.", :status => 404
end

and I have the following route:

 match '/auth/google/setup' => 'session#setup_google'

I made it work with facebook, twitter, linkedin and foursquare. It not seems to be a routes problem, I done it right for all the others strategies, but with google keeps failing. Apparently never enters to the setup_google method.

What am I missing? any clue o this?

Thanks in advance.

Use profile scope instead of contacts?

When omniauth-google was first written, I don't think the profile scope was available. Now Google has a couple userinfo scopes that may be better to use than the contacts scope:

userinfo.profile:

Gain read-only access to basic profile information, including a user identifier, name, profile photo, profile URL, country, language, timezone, and birthdate.

userinfo.email:

Gain read-only access to the user's email address.

See Google's description (including the full scope urls) at:
https://developers.google.com/accounts/docs/OAuth2Login#scopeparameter

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.