Socket
Book a DemoInstallSign in
Socket

omniauth-heap

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

omniauth-heap

0.1.3
bundlerRubygems
Version published
Maintainers
1
Created
Source

OmniAuth Heap

Heap OAuth2 Strategy for OmniAuth.

Read the Heap OAuth docs for more details:

Installing

Add to your Gemfile:

gem 'omniauth-heap'

Then bundle install.

Usage

OmniAuth::Strategies::Heap is simply a Rack middleware. Read the OmniAuth docs for detailed instructions: https://github.com/intridea/omniauth.

Here's a quick example, adding the middleware to a Rails app in config/initializers/omniauth.rb:

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :heap, ENV['OAUTH_HEAP_KEY'], ENV['OAUTH_HEAP_SECRET'], scope: 'segment'
end

segment is the only currently supported Scope (as of Feb 2022)

To start the authentication process with Heap you simply need to access /auth/heap route.

Callback URL

You define a callback URL in Heap that is matched 1-1 (no query string parameters allowed). To make sure the value entered into Heap matches exactly, define the callback URL as an environment variable.

OAUTH_HEAP_CALLBACK_URL="https://auth.example.com/auth/heap/callback"

Auth Hash

Here's an example Auth Hash available in request.env['omniauth.auth']:

{
  :provider => 'heap',
  :uid => 'fa267e34-ebd3-463f-92db-e065932cee90',
  :info => {
    :email => 'pam@example.co',
    :env_id => '2544353',
  },
  :credentials => {
    :token => 'ehJy6IkiOiJFUzUxGcGnR5cMiXVCJ9.eyJqdGk47eiOiIc209c5eiJod431ce3272dd213a9...',
    :expires => false
  },
  :extra => {
    :raw_info => {
      :env_id => '2544353',
      :partner_app_id => '4',
      :authorized_by => 'pam@example.co',
      :authorized_scope => 'segment',
      :authorized_at_utc => '2022-01-18T17:37:30.119148Z',
    }
  }
}

FAQs

Package last updated on 29 Jan 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.