Skip to content

Commit

Permalink
Update the README for v4
Browse files Browse the repository at this point in the history
  • Loading branch information
jonmarkgo committed Nov 11, 2024
1 parent 72c6281 commit d4c26a8
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,16 @@
[![Test](https://github.com/MLH/omniauth-mlh/actions/workflows/test.yml/badge.svg)](https://github.com/MLH/omniauth-mlh/actions/workflows/test.yml)

This is the official [OmniAuth](https://github.com/omniauth/omniauth) strategy for
authenticating with [MyMLH](https://my.mlh.io). To use it, you'll need to
[register an application](https://my.mlh.io/oauth/applications) and obtain a OAuth Application ID and Secret from MyMLH.
authenticating with [MyMLH](https://my.mlh.io) in Ruby applications. To use it, you'll need to
[register an application](https://my.mlh.io/developers) and obtain a OAuth Application ID and Secret from MyMLH.

It now supports MyMLH API V3. [Read the MyMLH V3 docs here](https://my.mlh.io/docs).
It now supports MyMLH API V4. [Read the MyMLH V4 docs here](https://my.mlh.io/developers/docs).

Once you have done so, you can follow the instructions below:

## Requirements

This Gem requires your Ruby version to be at least `2.2.0`, which is set
downstream by [Omniauth](https://github.com/omniauth/omniauth/blob/master/omniauth.gemspec#L22).
This Gem requires your Ruby version to be at least `3.2.0`.

## Installation

Expand All @@ -34,9 +33,11 @@ Or install it yourself as:

## Usage (Rack)

You can find a list of potential scopes and expandable fields in the [docs](https://my.mlh.io/developers/docs). The below defaults are provided simply as an example.

```ruby
use OmniAuth::Builder do
provider :mlh, ENV['MY_MLH_KEY'], ENV['MY_MLH_SECRET'], scope: 'default email birthday'
provider :mlh, ENV['MY_MLH_KEY'], ENV['MY_MLH_SECRET'], scope: 'public offline_access user:read:profile', expand_fields: ['education']
end
```

Expand All @@ -46,7 +47,7 @@ end
# config/devise.rb

Devise.setup do |config|
config.provider :mlh, ENV['MY_MLH_KEY'], ENV['MY_MLH_SECRET'], scope: 'default email birthday'
config.provider :mlh, ENV['MY_MLH_KEY'], ENV['MY_MLH_SECRET'], scope: 'public offline_access user:read:profile', expand_fields: ['education']
end
```

Expand All @@ -61,6 +62,6 @@ We used part of [datariot/omniauth-paypal](http://github.com/datariot/omniauth-p
## Questions?

Have a question about the API or this library? Start by checking out the
[official MyMLH documentation](https://my.mlh.io/docs). If you still can't
[official MyMLH documentation](https://my.mlh.io/developers/docs). If you still can't
find an answer, tweet at [@MLHacks](http://twitter.com/mlhacks) or drop an
email to [engineering@mlh.io](mailto:engineering@mlh.io).

0 comments on commit d4c26a8

Please sign in to comment.