Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7047495
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:46:42+00:00 2026-05-28T02:46:42+00:00

I use Omniauth to let users login with Github. Step 1. The user is

  • 0

I use Omniauth to let users login with Github.

Step 1. The user is sent to /auth/github and then redirected to github to login.

Step 2. The user authenticates itself and Github return this string and a code parameter:

<# extra=# private_gists=0 public_gists=0 public_repos=0 total_private_repos=0 type="User" url="https://api.github.com/users/XXXXX">> info=#> provider="github" uid=13XXXXX>

params[:code] = CODEXXXXXXXXX

Step 2. Then, I try to retreive the token by sending a post request to :

https://github.com/login/oauth/access_token

with parameters: client_id, client_secret and the code received in step 1 but I get 404.

Question 1: Are these steps correct or am I missing something ?

Question 2: What are the parameters that I need to save in the database to authenticate after successful login (I use a User model).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T02:46:43+00:00Added an answer on May 28, 2026 at 2:46 am

    If you are using Omniauth, you should just point the user to

    "/auth/github"
    

    and then set a route like this:

    match '/auth/:provider/callback', :to => 'sessions#create'
    match '/auth/failure', :to => 'sessions#failure'
    

    Omniauth will handle everything else and you will be returned a hash with all the user information.

    Then to get the access token, you have to submit a post request as follows:

    POST https://github.com/login/oauth/access_token?
    client_id=...&
    redirect_uri=http://www.example.com/oauth_redirect&
    client_secret=...&
    code=...
    

    I think you are missing the redirect_uri, so GitHub is redirecting by submitting a GET request to https://github.com/login/oauth/access_token, which returns a 404 error.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What is the best practice for combining Facebook login (let's say I'll use Omniauth
I'm trying to use OmniAuth in a sinatra app with google as the login
I've set up user auth for my rails App with Devise and Omniauth. Now
Hi I'm creating a project in which I use OmniAuth to authenticate a user.
I'm using OmniAuth as a way to let users link their social networks into
In my rails 3 app I use Omniauth for the user authentication part (fb/twitter).
When you use OmniAuth to login to a web app through Facebook, these are
Use case: user clicks the link on a webpage - boom! load of files
Use Case When a user goes to my website, they will be confronted with
I'm using Omniauth to allow users to sign in (and create an account) through

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.