Skip to content

Commit

Permalink
Initial release
Browse files Browse the repository at this point in the history
  • Loading branch information
eviltrout committed Feb 19, 2015
0 parents commit 705f337
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
auto_generated

## Environment normalisation:
/.bundle
/vendor/bundle

# these should all be checked in to normalise the environment:
# Gemfile.lock, .ruby-version, .ruby-gemset

# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
.rvmrc
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2014 Discourse

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
discourse-meteor
===================

A Discourse Plugin to enable authentication via Meteor.

License
=======

MIT
33 changes: 33 additions & 0 deletions plugin.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# name: discourse-meteor
# about: Meteor's OAuth Plugin
# version: 0.1
# authors: Robin Ward

require_dependency 'auth/oauth2_authenticator.rb'

class MeteorAuthenticator < ::Auth::OAuth2Authenticator
def register_middleware(omniauth)
omniauth.provider :oauth2,
:name => 'meteor',
:client_id => GlobalSetting.meteor_client_id,
:client_secret => GlobalSetting.meteor_client_secret,
:provider_ignores_state => true,
:client_options => {
:site => 'https://www.meteor.com',
:authorize_url => '/oauth2/authorize',
:token_url => '/oauth2/token'
}
end
end

auth_provider title: "with Meteor",
authenticator: MeteorAuthenticator.new('meteor'),
message: "Meteor"

register_css <<CSS
button.btn-social.meteor {
background-color: #de4f4f;
}
CSS

0 comments on commit 705f337

Please sign in to comment.