+
  • 1
    Setup your application’s code
  • 2
    Create an app in Auth0 dashboard
  • 3
    Create a social connection

Setup your application's code

gem 'jwt'

Add the following lines to your base code

require 'jwt'
def authenticate!
  # Extract <token> from the 'Bearer <token>' value of the Authorization header
  supplied_token = String(request.env['HTTP_AUTHORIZATION']).slice(7..-1)

  JWT.decode supplied_token, 'YOUR_CLIENT_SECRET',
    true, # Verify the signature of this token
    algorithm: 'HS256',
    iss: 'https://YOUR_AUTH0_DOMAIN',
    verify_iss: true,
    aud: 'YOUR_CLIENT_ID',
    verify_aud: true

rescue JWT::DecodeError => e
  halt 401, json(error: e.class, message: e.message)
end

before do
  @auth_payload, @auth_header = authenticate!
end

Create an Application in Auth0 dashboard 

Create an Application in Auth0 dashboard

Install the Custom Social Connection extension under Extensions 

installing-custom-social-connections

List the app under the Installed Extensions tab. Click on the Custom Social Connections

Installed Extensions tab

Create a AzureADv2 (oauth2) connection under Custom Social Connections

Authorize the Custom Social Connections app

Configure your connection settings and enable your application under the Apps tab

Configure Social Connection Settings
GET STARTED IN MINUTES

Authentication Built for Security & High Availability

Auth0 is the easiest way for developers to integrate enterprise-grade authentication and identity management to any app.

Industry Standard Compliance

SOC 2, HIPAA/BAA, EU/US Privacy Shield Framework, Open ID Certified.

Learn More
Built by Security Experts

Continuously reviewed and tested by external security experts. Strong password encryption and hashing algorithms, at rest and in transit.

Learn More
What Our Customers Say

Continuously reviewed and tested by external security experts. Strong password encryption and hashing algorithms, at rest and in transit.

Learn More
Availability & trust

Uptime time in 3 different regions.

Learn More
Host Anywhere

Deploy On-Premises or on Cloud on your data center or Auth0’s one.

Learn More

Get Auth0 free for 7,000 active users per month with unlimited logins

  • Single Sign On
  • Passwordless Login
  • Up to 2 Social Identity Providers
  • Multifactor Authentication
  • User Management
  • Extensibility (Run custom code on Auth)

Some of the companies that trust us every day