All Projects → maccman → Omniauth Humanapi

maccman / Omniauth Humanapi

Licence: mit
OmniAuth strategy for HumanAPI.

Programming Languages

ruby
36898 projects - #4 most used programming language

OmniAuth Humanapi

This is a OmniAuth strategy for authenticating to HumanAPI. To use it, you'll need to sign up for an OAuth2 Application ID and Secret on the Human API applications page.

Basic Usage

use OmniAuth::Builder do
  provider :humanapi, ENV['HUMANAPI_KEY'], ENV['HUMANAPI_SECRET']
end

Example Sinatra usage

get '/auth/humanapi/callback' do
  auth   = env['omniauth.auth']
  uid    = auth[:uid]
  email  = auth[:info][:email]
  token  = auth[:credentials][:token]
  'ok'
end

Pre-registration

HumanAPI allows you to pre-register users so they won't have to sign up themselves. By pre-registering, you will receive a humanId for every user. This has to be passed as a query parameter to the authentication path:

/auth/humanapi?human_id=52867cbede3155565f000a0d
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].