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

omniauth-figma-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-figma-oauth2

  • 1.0.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

OmniAuth Figma

A Figma OAuth2 strategy for OmniAuth.

Installation

Add this line to your application's Gemfile:

gem 'omniauth-figma-oauth2'
gem 'omniauth-rails_csrf_protection'

And then execute:

$ bundle

Or install it yourself as:

$ gem install omniauth-figma-oauth2

Usage

Register your application with Figma to receive your Client ID and Secret key: https://www.figma.com/developers/apps

This is an example that you might put into a Rails initializer at config/initializers/omniauth.rb:

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :figma, ENV['CLIENT_ID'], ENV['CLIENT_SECRET']
end

You can now access the OmniAuth Figma OAuth2 URL: /auth/figma.

Make sure that all links to /auth/figma use POST requests. For example:

link_to 'Sign in via Figma', '/auth/figma', method: :post
# or
button_to 'Sign in via Figma', '/auth/figma'

For more info check: https://github.com/omniauth/omniauth/wiki/Resolving-CVE-2015-9284

Auth Hash

Here's an example Auth Hash available in request.env['omniauth.auth']:

{
  provider: 'figma',
  uid: '510245748683192988',
  info: {
    email: 'john@doe.com',
    name: 'John',
    image: 'https://s3-alpha.figma.com/static/user_j.png',
  },
  credentials: {
    access_token: '<TOKEN>',
    expires_in: '<EXPIRATION (in seconds)>',
    refresh_token: 'refresh_token'
  }
}

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/phiele/omniauth-figma-oauth2.

License

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

FAQs

Package last updated on 22 Aug 2024

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