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 5840867
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T11:48:41+00:00 2026-05-22T11:48:41+00:00

I recently forked https://github.com/fortuity/rails3-mongoid-omniauth and tried to get login working for different providers. It

  • 0

I recently forked https://github.com/fortuity/rails3-mongoid-omniauth and tried to get login working for different providers. It works for Twitter and Facebook (You can try it out at http://jgodse-omniauth-mongoid.heroku.com/), but I couldn’t get it working for Github. The code snapshot is here at github.

My environment looks like this:

$ heroku info
=== jgodse-omniauth-mongoid
Web URL:        http://jgodse-omniauth-mongoid.heroku.com/
Git Repo:       git@heroku.com:jgodse-omniauth-mongoid.git
Dynos:          1
Workers:        0
Repo size:      7M
Slug size:      5M
Stack:          bamboo-mri-1.9.2
Data size:      (empty)
Addons:         Basic Logging, MongoHQ MongoHQ Free, Shared Database 5MB
Owner:          xxxxx@yyy.com

Jay@JAY-PC ~/rapps/rails3-mongoid-omniauth (master)
$ heroku config --long
BUNDLE_WITHOUT      => development:test
DATABASE_URL        => postgres://xxxxxxxxxxxxxxxxxxxx.compute-1.amazonaws.com/rrretnhwhj
FACEBOOK_APP_ID     => xxxxxxxxxxxxxxxxxxxx
FACEBOOK_APP_SECRET => xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
GITHUB_CLIENT_ID    => xxxxxxxxxxxxxxxxxxxxx
GITHUB_SECRET       => xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
LANG                => en_US.UTF-8
MONGOHQ_URL         => mongodb://heroku:9xxxxxxxxxxxxxxxx.mongohq.com:27098/app527030
RACK_ENV            => production
SHARED_DATABASE_URL => postgres://xxxxxxxxxxxxxxxxxxxxx.compute-1.amazonaws.com/rrretnhwhj
TWITTER_KEY         => xxxxxxxxxxxxxxxxxxx
TWITTER_SECRET      => xxxxxxxxxxxxxxxxxxxxxxxxxxxx

My github information for “OAuth Application: Jay’s Rails3 Mongoid OAuth” is as follows (from my app profile page):

Authorization Token:   https://github.com/login/oauth/authorize
Access Token URL:      https://github.com/login/oauth/access_token
URL:     http://jgodse-omniauth-mongoid.heroku.com/
Callback URL:   http://jgodse-omniauth-mongoid.heroku.com/
Client ID: xxxxxxx
Secret:    xxxxxxxxxxxxxxxx

The client and secret are set as environment variables in omniauth.rb

The authentication happens, but it redirects to http://jgodse-omniauth-mongoid.heroku.com/?error=redirect_uri_mismatch and I haven’t apparently logged in. If I change the Callback URL to http://jgodse-omniauth-mongoid.heroku.com/callback, the application crashes.

What am I missing to get github authentication to work?

  • 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-22T11:48:41+00:00Added an answer on May 22, 2026 at 11:48 am

    I don’t fu%^&*g believe this.

    I went to github.com where the application secret, key, url, callback is configured and removed the trailing slash from the “Callback URL” and “URL”, and it worked.

    URL: http://jgodse-omniauth-mongoid.heroku.com
    Callback URL:  http://jgodse-omniauth-mongoid.heroku.com
    

    This is nuts! Twitter wants the trailing slash on the callback but Github does not. Github and twitter should allow both and then trim it automatically if needed.

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

Sidebar

Related Questions

No related questions found

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.