Coder Social home page Coder Social logo

omniauth-meetup's Introduction

OmniAuth Meetup

Build Status

OmniAuth::Strategies::Meetup is an OmniAuth strategy for authenticating to meetup.com with OAuth2. Read detailed information about the meetup.com implementation of OAuth2 here

Installing

Add to your Gemfile:

    gem 'omniauth-meetup'

Then bundle install.

Usage

To get started you will need to register an OAuth Consumer in your meetup.com account here

Here's a quick example, adding the middleware to a Rails app in config/initializers/omniauth.rb:

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :meetup, ENV['MEETUP_KEY'], ENV['MEETUP_SECRET']
end

You can then implement your authentication as usual with OmniAuth as shown in the excellent Railscast 241

##Authentication Hash

Here's an example Authentication Hash available in request.env['omniauth.auth']:

{"provider"=>"meetup",
 "uid"=>0,
 "info"=>
  {"id"=>0,
   "name"=>"elvis",
   "photo_url"=>"http://photos3.meetupstatic.com/photos/member_pic_0.jpeg"},
 "credentials"=>
  {"token"=>"abc123...",         # OAuth 2.0 access_token, which you may wish to store
   "refresh_token"=>"bcd234...", # This token can be used to refresh your access_token later
   "expires_at"=>1324720198,     # when the access token expires (Meetup tokens expire in 1 hour)
   "expires"=>true},
 "extra"=>
  {"raw_info"=>
    {"lon"=>-90.027181,
     "link"=>"http://www.meetup.com/members/0",
     "lang"=>"en_US",
     "photo"=>
      {"photo_link"=> "http://photos3.meetupstatic.com/photos/member_pic_0.jpeg",
       "highres_link"=> "http://photos1.meetupstatic.com/photos/member_pic_0_hires.jpeg",
       "thumb_link"=> "http://photos1.meetupstatic.com/photos/member_pic_0_thumb.jpeg",
       "photo_id"=>0},
     "city"=>"Memphis",
     "country"=>"us",
     "visited"=>1325001005000,
     "id"=>0,
     "topics"=>[],
     "joined"=>1147652858000,
     "name"=>"elvis",
     "other_services"=>{"twitter"=>{"identifier"=>"@elvis"}},
     "lat"=>35.046677
    }
  }
}

License

Copyright (c) 2011 by Miles Woodroffe

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

omniauth-meetup's People

Contributors

cczona avatar russ avatar tapster avatar trikro avatar

Watchers

 avatar  avatar

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.