Skip to content

Latest commit

 

History

History
70 lines (51 loc) · 1.44 KB

File metadata and controls

70 lines (51 loc) · 1.44 KB

OmniAuth Line

This gem contains the Line OAuth2 Strategy for OmniAuth.

Supports the OpenID Connect Web Login. Read the Line developers docs for more details: https://developers.line.me/en/docs/line-login/web/integrate-line-login/

Using This Strategy

First start by adding this gem to your Gemfile:

gem 'omniauth-line'

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

# PROFILE permission required!!
Rails.application.config.middleware.use OmniAuth::Builder do
  provider :line, "Channel_ID", "Channel_Secret"
end

Authentication Hash

An example auth hash available in request.env['omniauth.auth']:

{
  :provider => "line",
  :uid => "a123b4....",
  :info => {
    :name => "yamada tarou",
    :image => "http://dl.profile.line.naver.jp/xxxxx",
    :description => "breakfast now.",
  },
  :credentials => {
    :token => "a1b2c3d4...", # The OAuth 2.0 access token
    :secret => "abcdef1234"
  },
  :extra => {
    # nil
  }
}

Supported Rubies

OmniAuth Line is tested and compatible with:

  • Ruby 2.7.6
  • Ruby 3.0.7
  • Ruby 3.1.7

This gem works with any Rack-based application (Rails, Sinatra, etc.).

Development

After checking out the repo, run bundle install to install dependencies.

To run tests:

bundle exec rspec

To run tests for all supported Ruby versions (requires rbenv or rvm):

bin/test_all