Coder Social home page Coder Social logo

kufu / omniauth-redirect-proxy Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fs/omniauth-redirect-proxy

0.0 13.0 0.0 24 KB

Simple redirect proxy to deal with unauthorized callback error in Google Oauth2

License: MIT License

Ruby 91.75% Shell 8.25%

omniauth-redirect-proxy's Introduction

OmniAuth redirect proxy

Problem

When you need to use OmniAuth with Google on not registered domain in Google Developer console it's a crap.

For example if you would like to use Heroku review apps each time you need to register new domain in the Developer Console to let OAuth work.

Solution

We could use this redirect proxy as a single point for callback which should be registered in Google Developer console.

Redirect proxy will catch up callback request from Google and redirect it back to application.

The trick is โ€“ application domain should be encoded with Base64 in the state parameter.

So we will have following flow:

OmniAuth setup

In your app you need setup Omniauth.config.full_host to http://oauth-redirect-proxy.herokuapp.com

And encode request.base_url with Base64.encode64 in to state parameter.

Deploy

Just deploy to Heroku as regular Ruby application

heroku create
git push heroku master

Install

bin/setup

Quality tools

  • bin/quality based on RuboCop
  • .rubocop.yml describes active checks

Develop

bin/build checks your specs and runs quality tools

Credits

Ruby Base is maintained by Timur Vafin. It was written by Flatstack with the help of our contributors.

omniauth-redirect-proxy's People

Contributors

timurvafin avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.