Skip to content

Commit 06c3f50

Browse files
committed
chore: init commit
0 parents  commit 06c3f50

File tree

19 files changed

+367
-0
lines changed

19 files changed

+367
-0
lines changed

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# EditorConfig is awesome: https://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
[*]
7+
indent_style = space
8+
indent_size = 2
9+
end_of_line = lf
10+
charset = utf-8
11+
trim_trailing_whitespace = true
12+
insert_final_newline = true

.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/.bundle/
2+
/.yardoc
3+
/_yardoc/
4+
/coverage/
5+
/doc/
6+
/pkg/
7+
/spec/reports/
8+
/tmp/
9+
Gemfile.lock
10+
11+
# rspec failure tracking
12+
.rspec_status

.prettierrc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
rubySingleQuote: false

.rspec

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
--format documentation
2+
--color
3+
--require spec_helper

.rubocop.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
inherit_gem:
2+
prettier: rubocop.yml
3+
4+
Style/StringLiterals:
5+
EnforcedStyle: double_quotes

Gemfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
source "https://rubygems.org"
2+
3+
# Specify your gem's dependencies in omniauth-open-edx.gemspec
4+
gemspec

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) International Business Machines Corporation
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# OmniAuth::OpenEdx
2+
3+
This is the OmniAuth stragegy for authenticaing to Open edX.
4+
5+
Note, this strategy only works with Open edX `juniper` release or above.
6+
7+
## Installation
8+
9+
Add to your `Gemfile`:
10+
11+
```ruby
12+
gem "omniauth-open-edx"
13+
```
14+
15+
## Open edX OAuth2 Toolkit Setup
16+
17+
- Go to `${LMS_URL}/admin/oauth2_provider/application`
18+
- Add a new application
19+
- Enter redirect url, this depends on your setup, learn more from [examples](./examples)
20+
- Select `Confidential` client type, `Authorization code` authorization grant type
21+
- Get the `Client id` and `Client secret` and configure them in your ruby application
22+
23+
## Usage
24+
25+
```ruby
26+
use OmniAuth::Builder do
27+
provider :open_edx,
28+
ENV["OPEN_EDX_OAUTH_CLIENT_ID"],
29+
ENV["OPEN_EDX_OAUTH_CLIENT_SECRET"],
30+
{
31+
scope: "profile email",
32+
client_options: {
33+
site: "https://courses.edx.org",
34+
},
35+
}
36+
end
37+
```
38+
39+
## License
40+
41+
[MIT License](./LICENSE).

Rakefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
require "bundler/gem_tasks"
2+
require "rspec/core/rake_task"
3+
4+
RSpec::Core::RakeTask.new(:spec)
5+
6+
task default: :spec

bin/console

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env ruby
2+
3+
require "bundler/setup"
4+
require "omniauth-open-edx"
5+
6+
# You can add fixtures and/or initialization code here to make experimenting
7+
# with your gem easier. You can also use a different console, if you like.
8+
9+
# (If you use this, don't forget to add pry to your Gemfile!)
10+
# require "pry"
11+
# Pry.start
12+
13+
require "irb"
14+
IRB.start(__FILE__)

0 commit comments

Comments
 (0)