Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

omniauth-box-oauth2

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

omniauth-box-oauth2

  • 1.0.0.pre
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Gem Version Build Status

OmniAuth::Strategies::BoxOauth2

OAuth2 Strategy for Box

Installation

Add this line to your application's Gemfile:

gem 'omniauth-box-oauth2'

And then execute:

$ bundle

Or install it yourself as:

$ gem install omniauth-box-oauth2

Usage

You can register your application here and get client_id & client_secret.

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

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :box_oauth2, ENV["BOX_CLIENT_ID"], ENV["BOX_CLIENT_SECRET"]
end

Or If your are using devise add follwing in config/initializers/devise.rb

config.omniauth :box_oauth2, ENV["BOX_CLIENT_ID"], ENV["BOX_CLIENT_SECRET"]

Sample Auth Hash

{
  "provider"=>"box_oauth2",
  "uid"=>"123456",
  "info"=> {
    "name"=>"Pramod Shinde",
    "email"=>"box_user@email.com",
    "job_title"=>"Ruby On Rails Developer",
    "image"=>"https://app.box.com/api/avatar/large/123456",
    "phone"=>"1234567890",
    "address"=>"address",
    "status"=>"active"
  },
  "credentials"=> {
    "token"=>"box_access_token",
    "refresh_token"=>"box_refresh_token",
    "expires_at"=>1451681914,
    "expires"=>true
  },
  "extra"=> {
    "raw_info"=> {
      "type"=>"user",
      "id"=>"123456",
      "name"=>"Pramod Shinde",
      "login"=>"box_user@email.com",
      "created_at"=>"2014-10-28T00:04:41-07:00",
      "modified_at"=>"2016-01-01T10:11:16-08:00",
      "language"=>"en",
      "timezone"=>"America/Los_Angeles",
      "space_amount"=>10737418240,
      "space_used"=>301803,
      "max_upload_size"=>2147483648,
      "status"=>"active",
      "job_title"=>"Ruby On Rails Developer",
      "phone"=>"1234567890",
      "address"=>"address",
      "avatar_url"=>"https://app.box.com/api/avatar/large/123456"
    }
  }
}

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/omniauth-box-oauth2. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

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

FAQs

Package last updated on 02 Jan 2016

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc