File: README.md

package info (click to toggle)
ruby-omniauth-ultraauth 0.0.2-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 140 kB
  • sloc: ruby: 38; sh: 4; makefile: 3
file content (78 lines) | stat: -rw-r--r-- 1,924 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# OmniAuth::UltraAuth

## Installation

Add the following to Gemfile:

    gem 'omniauth-ultraauth'

Install it using Bundler:

    $ bundle
    
## Before You Begin

You will require to create an application on https://ultraauth.com

1. Create an account and login to https://ultraauth.com
2. Go to "Create an App" and select "Ruby on Rails"
3. Click on "Edit Callback URL". The URL should be your host followed by `/auth/ultraauth/callback`. For example, http://localhost:3000/auth/ultraauth/callback

## Usage

Example configuration:

If you are using Rails, your `config/intializers/omniauth.rb` file should look like this:
```ruby
Rails.application.config.middleware.use OmniAuth::Builder do
  provider :ultraauth, "CLIENT_ID", "CLIENT_SECRET", client_options: {
    redirect_uri: "CALLBACK_URI" # i.e. http://localhost:3000/auth/ultraauth/callback
  }
end
```

Replace "CLIENT_ID", "CLIENT_SECRET", "CALLBACK_URI" with the values from the application you created on https://ultraauth.com

## Authentication Hash

An example of auth hash returned from the server available under `request.env['omniauth.auth']`:

```
 {
  "provider": "ultraauth",
  "uid": "abcd1234...",
  "info": {
    "name": null,
    "email": null,
    "nickname": null,
    "first_name": null,
    "last_name": null,
    "gender": null,
    "image": null,
    "phone": null,
    "urls": {
      "website": null
    }
  },
  "credentials": {
    "id_token": "abcd1234...",
    "token": "abcd1234...",
    "refresh_token": null,
    "expires_in": 3600,
    "scope": "openid"
  },
  "extra": {
    "raw_info": {
      "sub": "abcd1234...."
    }
  }
}
```

## Contributing

1. Fork it ( http://github.com/ultraauth/omniauth-ultraauth/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request