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

omniauth-ssl

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

omniauth-ssl

  • 0.1.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Omniauth::SSL

  1. Add gem to Gemfile and bundle gem "omniauth-ssl"
  2. Add the following ENV variables
OMNIAUTH_SSL_CLIENT_ID = ""
OMNIAUTH_SSL_CLIENT_SECRET = ""
OMNIAUTH_SSL_CLIENT_SCOPE = ""
OMNIAUTH_SSL_SITE = "http://127.0.0.1:3001"
OMNIAUTH_SSL_AUTHORIZE_URL = "http://127.0.0.1:3001/oauth2/authorize"
OMNIAUTH_SSL_TOKEN_URL = "http://127.0.0.1:3001/oauth2/token"
  1. Add configuration to config/initializers/omniauth.rb
Rails.application.config.middleware.use OmniAuth::Builder do
  provider :ssl, 
    ENV["OMNIAUTH_SSL_CLIENT_ID"], 
    ENV["OMNIAUTH_SSL_CLIENT_SECRET"], 
    scope: ENV["OMNIAUTH_SSL_CLIENT_SCOPE"],
    client_options: {
      site: ENV["OMNIAUTH_SSL_SITE"],
      authorize_url: ENV["OMNIAUTH_SSL_AUTHORIZE_URL"]
      token_url: ENV["OMNIAUTH_SSL_TOKEN_URL"]
    }
end
  1. Add routes to your user sessions callback controller (will be unique depending on how your app is configured. you will need to change the to: paramaeters to match your app)
match "/auth/:provider/callback", to: "sessions#create", via:[:post, :get]
  1. Redirect User to oauth server
= link_to "log in with SSL", "/auth/ssl", method: :post
  1. Access the OmniAuth return and process login (You will need to create your custom logic here in rails to handle the token etc)
request.env['omniauth.auth']
request.env['omniauth.auth'].credentials.access_token 
request.env['omniauth.auth'].credentials.refresh_token      
request.env['omniauth.auth'].info

FAQs

Package last updated on 28 May 2021

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