Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

This is the official OmniAuth strategy for authenticating to LinuxFr.org

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .rspec
Octocat-spinner-32 Gemfile
Octocat-spinner-32 MIT-LICENSE
Octocat-spinner-32 README.md
Octocat-spinner-32 omniauth-linuxfr.gemspec
README.md

OmniAuth LinuxFr.org

This is the official OmniAuth strategy for authenticating to LinuxFr.org. To use it, you'll need to sign up for an OAuth2 Application ID and Secret on the LinuxFr.org Applications Page.

Basic Usage

#!/usr/bin/env ruby
# encoding: utf-8

require 'sinatra'
require 'omniauth'
require 'omniauth-linuxfr'


use Rack::Session::Cookie
use OmniAuth::Builder do
  provider :linuxfr, ENV['LINUXFR_KEY'], ENV['LINUXFR_SECRET']
end


get '/' do
  <<-HTML
    <a href="/auth/linuxfr">Se connecter avec LinuxFr.org</a>
  HTML
end

get '/auth/linuxfr/callback' do
  auth = request.env['omniauth.auth']

  <<-HTML
    <ul>
      <li>login: #{auth.info.login}</li>
      <li>email: #{auth.info.email}</li>
      <li>date:  #{auth.info.created_at}</li>
    </ul>
  HTML
end

Copyright

The code is licensed as MIT. See the MIT-LICENSE file for the full license.

♡2011 by Bruno Michel. Copying is an act of love. Please copy and share.

Something went wrong with that request. Please try again.