Skip to content
qnyp Strategy for OmniAuth πŸ”
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


This is the official OmniAuth strategy for authenticating to qnyp. To use it, you'll need to register your application on qnyp Applications Page (Login required).

Using This Strategy

First start by adding this gem to your Gemfile:

gem 'omniauth-qnyp'

Next, tell OmniAuth about this provider. For a Rails app, your config/initializers/omniauth.rb file should look like this:

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :qnyp, ENV.fetch('QNYP_APP_ID'), ENV.fetch('QNYP_APP_SECRET'), scope: 'public'

Replace QNYP_APP_ID and QNYP_APP_SECRET with your application ID and application secret.


qnyp API lets you set scopes to provide granular access to different types of data.

If you want to access public information by API, specify scope: option with public:

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :qnyp, '...', '...', scope: 'public'

Or, if you want to access public information and write a log by API, specify scope: option with public write:

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :qnyp, '...', '...', scope: 'public write'

Auth Hash Schema

OmniAuth will return an authentication hash similar to the example below. Learn more about the Auth Hash Schema.

  "provider" => "qnyp",
  "uid" => 1, # User ID
  "info" => {
    "language" => "ja", # Preffered language for UI (ja or en)
    "name" => "junya", # Name for display
    "profile_image_url" => "", # Profile image URL
    "username" => "junya", # Username (unique identifier)
  "credentials" => {
    "expires" => false,
    "token" => "...", # Access token


After checking out the repo, run bin/setup to install dependencies. Then, run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release to create a git tag for the version, push git commits and tags, and push the .gem file to


  1. Fork it ( )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request


The MIT License (MIT) Copyright (c) 2017 qnyp, LLC.

See LICENSE.txt.

You can’t perform that action at this time.