GithubHelp home page GithubHelp logo

deepak / omniauth-auth0 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from auth0/omniauth-auth0

0.0 1.0 1.0 214 KB

Omniauth strategy for the Auth0 platform.

License: MIT License

Ruby 100.00%

omniauth-auth0's Introduction

Build Status

OmniAuth Auth0

This is the official OmniAuth strategy for authenticating to Auth0.

Installing

Add to your Gemfile:

gem 'omniauth-auth0'

Then bundle install.

Basic Usage

Rails

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :auth0, ENV['AUTH0_CLIENT_ID'], ENV['AUTH0_CLIENT_SECRET'], ENV['AUTH0_DOMAIN']
end

If you want to force an identity provider you can simply redirect to the Omniauth path like this:

redirect_to '/auth/auth0?connection=CONNECTION_NAME'

Sinatra

use OmniAuth::Builder do
  provider :auth0, ENV['AUTH0_CLIENT_ID'], ENV['AUTH0_CLIENT_SECRET'], ENV['AUTH0_DOMAIN']
end

Optional you can set the :provider_ignores_state passing a fourth parameter. By default it is true.

If you want to force to force an identity provider you can simply redirect to Omniauth path like this:

redirect to('/auth/auth0?connection=CONNECTION_NAME')

Login widget

Integrate the widget in one of your pages as described here or use links as described in the same link.

Auth Hash

	{
	  :provider => 'auth0',
	  :uid => 'google-oauth2|this-is-the-google-id',
	  :info => {
	    :name => 'John Foo',
	    :email => '[email protected]',
	    :nickname => 'john',
	    :first_name => 'John',
	    :last_name => 'Foo',
	    :location => 'en',
	    :image => 'https://example.org/john.jpg'
	  },
	  :credentials => {
	    :token => 'XdDadllcas2134rdfdsI',
	    :expires => 'false',
	    :id_token => 'eyJhbGciOiJIUzI1NiIsImN0eSI6IkpXVCJ9.eyJuYW1lIjoiSm9obiBGb28ifQ.lxAiy1rqve8ZHQEQVehUlP1sommPHVJDhgPgFPnDosg',
	    :token_type => 'bearer',
	  },
	  :extra => {
	    :raw_info => {
	      :email => '[email protected]',
	      :email_verified => 'true',
	      :name => 'John Foo',
	      :given_name => 'John',
	      :family_name => 'Foo',
	      :picture => 'https://example.org/john.jpg',
	      :gender => 'male',
	      :locale => 'en',
	      :clientID => 'nUBkskdaYdsaxK2n9',
	      :user_id => 'google-oauth2|this-is-the-google-id',
	      :nickname => 'john',
	      :identities => [{
	        :access_token => 'this-is-the-google-access-token',
	        :provider => 'google-oauth2',
	        :expires_in => '3599',
	        :user_id => 'this-is-the-google-id',
	        :connection => 'google-oauth2',
	        :isSocial => 'true',
	      }],
	      :created_at: '2014-07-15T17:19:50.387Z'
	    }
	  }
	}

ActionDispatch::Cookies::CookieOverflow issue

If you are getting this error it means that you are using Cookie sessions and since you are storing the whole profile it overflows the max-size of 4K.

You can change to use In-Memory store for development as follows:

# /config/initializers/session_store.rb
CrazyApp::Application.config.session_store :cache_store

# /config/environments/development.rb
config.cache_store = :memory_store

Documentation

For more information about auth0 contact our documentation page.

Issue Reporting

If you have found a bug or if you have a feature request, please report them at this repository issues section. Please do not report security vulnerabilities on the public GitHub issue tracker. The Responsible Disclosure Program details the procedure for disclosing security issues.

Author

Auth0

License

This project is licensed under the MIT license. See the LICENSE file for more info.

omniauth-auth0's People

Contributors

annyv2 avatar benschwarz avatar dentarg avatar ezequielm avatar hzalaz avatar jfromaniello avatar l4u avatar lindseyb avatar ntotten avatar pose avatar rolodato avatar sandrinodimattia avatar siacomuzzi avatar vmartynets avatar yvonnewilson avatar

Watchers

 avatar

Forkers

bangthetable

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.