Socket
Book a DemoInstallSign in
Socket

omniauth-chatwork

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

omniauth-chatwork

0.1.3
bundlerRubygems
Version published
Maintainers
1
Created
Source

OmniAuth::Chatwork

OmniAuth strategy for ChatWork

Gem Version Build Status Maintainability Coverage Status

Installation

Add this line to your application's Gemfile:

gem 'omniauth-chatwork'

And then execute:

$ bundle

Or install it yourself as:

$ gem install omniauth-chatwork

Usage

use OmniAuth::Builder do
  provider :chatwork, ENV["CLIENT_ID"], ENV["CLIENT_SECRET"]
  # or
  provider :chatwork, ENV["CLIENT_ID"], ENV["CLIENT_SECRET"], scope: ["users.all:read", "rooms.all:read_write", "contacts.all:read_write"]
end

And register https://YOURSERVER/auth/chatwork/callback to Redirect URI

redirect_uri

Configuring

Auth Hash

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

{
  provider: "chatwork",
  uid: 1111111,
  info: {
    name: "sue445",
    email: "sue445@example.com",
    description: "I am cure engineer!",
    image: "https://appdata.chatwork.com/avatar/ico_default_blue.png",
    urls: {
      profile: "http://github.com/sue445"
    }
  },
  credentials: {
    token: "XXXXXXXXXXXXXXXXXXX",
    refresh_token: "XXXXXXXXXXXXXXXXXXX",
    expires_at: 1510504991,
    expires: true
  },
  extra: {
    raw_info: {
      account_id: 1111111,
      room_id: 1111111,
      name: "sue445",
      chatwork_id: "",
      organization_id: 1111111,
      organization_name: "",
      department: "",
      title: "",
      url: "http://github.com/sue445",
      introduction: "I am cure engineer!",
      mail: "",
      tel_organization: "",
      tel_extension: "",
      tel_mobile: "",
      skype: "",
      facebook: "",
      twitter: "",
      avatar_image_url: "https://appdata.chatwork.com/avatar/ico_default_blue.png",
      login_mail: "sue445@example.com"
    }
  }
}

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also 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, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Run dummy app

At first, register https://127.0.0.1:4567/auth/chatwork/callback to Redirect URI

redirect_uri

cp .env.example .env
vi .env

bundle exec ruby spec/dummy/app.rb

open https://127.0.0.1:4567/

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/sue445/omniauth-chatwork.

License

The gem is available as open source under the terms of the MIT License.

FAQs

Package last updated on 20 Feb 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.