Code Monkey home page Code Monkey logo

rails3_github_oauth2_devise_example's Introduction

What is this?

This is an example Rails 3 application to login to Github using OAuth2 and Devise

For more details on Githubs OAuth2 Setup – GitHub OAuth Busy Developer’s Guide

I built this so I could learn how to use OAuth2 with Github, it provides an easy base to build your own apps

What it uses

  • Latest Rails 3 (GIT master)
  • Latest Devise (GIT master)
  • Latest OAuth2 Gem (v0.0.10)

Instructions

  • Clone me git clone git://github.com/lloydpick/rail3_github_oauth2_devise_example.git
  • Install latest beta bundler (because Rails 3 master needs it) gem install bundler --version 1.0.0.beta.4
  • Go go magic bundler bundle install
  • Create and migrate the database rake db:create & rake db:migrate

Register for an application – GitHub OAuth2 Application Registration – and fill in the form…

Name: My Super Cool App (Development)
Main URL: http://localhost:8080
Callback URL: http://localhost:8080/users/oauth2

Put the Client ID and Secret codes into the config/oauth2_config.yml file. By default this will have the
authorize_path and access_token_path setup correctly for Github Auth.

Then just boot up the app with the server of your choice and click the “Sign in with Github” link. It should
take you off to Github, ask you to authorize, then back to your app, creating a devise user, and logging you in.

Helpful Extra’s

While testing it helps to know where you can see all your OAuth2 applications this can be found here on github…

Github OAuth2 Applications

If you need to see or delete your OAuth2 connections for your GitHub account you can do that here…

Github OAuth2 Client Connections

License

Copyright © 2010 Lloyd Pick

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.

rails3_github_oauth2_devise_example's People

Contributors

lloydpick avatar

Stargazers

 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.