Giter Site home page Giter Site logo

g-proxy's Introduction

Deploy

g-proxy

Google authentication for internal services

This proxy handles sessions and makes it easy to secure internal services behind a Google Authentication. It acts as a gatekeeper to make sure only authenticated users are allowed to make requests to the origin. All requests are proxied to the origin as is, except for /login, /login/return and /logout paths.

The origin will receive following headers from the proxy:

  • x-key: <secret> Where secret is a shared secret between the proxy and origin. If the secret is correct, the origin can trust other headers.
  • x-user-name: John Doe Name of the authenticated user.
  • x-user-email: [email protected] Email of the authenticated user.
  • x-user-photo-url: https://gstatic.google.com/profile.jpg Profile picture url for the authenticated user.

FAQ

How to log out?

You redirect the user to /logout path, which will be handled at proxy level and causes session to be terminated.

Get started

  1. Install node environment

  2. Follow instructions in https://github.com/bitly/oauth2_proxy to create Google OAuth2 client id and secret

    If you host your internal service at https://internal.company.com, you should use following settings:

    • Authorized JavaScript origins: https://internal.company.com
    • Authorized redirect URIs: https://internal.company.com/login/return This handles the OAuth2 redirect from Google. This should be configured the same as CALLBACK_URL environment variable.

    You might need to enable Google+ API for the Google project to make auth working.

  3. npm i

  4. cp .env.sample .env and fill the blanks

  5. npm start

g-proxy's People

Contributors

cventus avatar kimmobrunfeldt avatar

Watchers

 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.