rodauth-omniauth 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -4
- data/lib/rodauth/features/omniauth.rb +1 -1
- data/rodauth-omniauth.gemspec +2 -1
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c6cc26306c21226fb3b6f07fcc3bfcc6390160f78aa0c8cbf87ff3e3b1fd2fd4
|
4
|
+
data.tar.gz: 9f3d0493b66cdb851e1b8af0e1d85e57544fcdaa6504509072a4edfdcde24d5f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c10572574a109db2a9d28ea84239154f7c380b23d4f48f543c3084ae6528c5b2878ed98adab2c9d489ced01ca106cd354b7f5dfa177e496b048c744082ddeb31
|
7
|
+
data.tar.gz: 60cf2d25aa82ccb6a6a9f69c01fca040912df718d952a7ad830e443b89589a11d9855d042298c34c1220548b1a4a3eb96252e992de0d8214b1e43f0f4add08f4
|
data/README.md
CHANGED
@@ -43,7 +43,7 @@ end
|
|
43
43
|
Then enable the `omniauth` feature and register providers in your Rodauth configuration:
|
44
44
|
|
45
45
|
```sh
|
46
|
-
$ bundle add omniauth-facebook omniauth-twitter, omniauth-
|
46
|
+
$ bundle add omniauth-facebook omniauth-twitter, omniauth-google-oauth2
|
47
47
|
```
|
48
48
|
```rb
|
49
49
|
plugin :rodauth do
|
@@ -55,6 +55,8 @@ plugin :rodauth do
|
|
55
55
|
end
|
56
56
|
```
|
57
57
|
|
58
|
+
It is important to note that `rodauth-omniauth` requires OmniAuth 2.x, and as such, is only compatible with omniauth gems that use the same.
|
59
|
+
|
58
60
|
You can now add authentication links to your login form:
|
59
61
|
|
60
62
|
```erb
|
@@ -191,8 +193,8 @@ The `omniauth` feature builds on top of the `omniauth_base` feature, which sets
|
|
191
193
|
plugin :rodauth do
|
192
194
|
enable :omniauth_base
|
193
195
|
|
194
|
-
omniauth_provider :github, ENV["
|
195
|
-
omniauth_provider :apple, ENV["
|
196
|
+
omniauth_provider :github, ENV["GITHUB_CLIENT_ID"], ENV["GITHUB_CLIENT_SECRET"], scope: "user"
|
197
|
+
omniauth_provider :apple, ENV["APPLE_CLIENT_ID"], ENV["APPLE_CLIENT_SECRET"], scope: "email name"
|
196
198
|
end
|
197
199
|
|
198
200
|
route do |r|
|
@@ -378,7 +380,7 @@ Content-Type: application/json
|
|
378
380
|
{ "error_type": "some_error", "error": "There was an error logging in with the external provider" }
|
379
381
|
```
|
380
382
|
|
381
|
-
In this flow, you'll need to configure the callback URL on the OAuth app to point to the frontend app.
|
383
|
+
In this flow, you'll need to configure the callback URL on the OAuth app to point to the frontend app. In the OmniAuth strategy, you'll need to configure the same redirect URL for OAuth requests, but keep the backend callback endpoint. For strategies based on [omniauth-oauth2], you can achieve this as follows:
|
382
384
|
|
383
385
|
```rb
|
384
386
|
omniauth_provider :github, ENV["GITHUB_CLIENT_ID"], ENV["GITHUB_CLIENT_SECRET"],
|
@@ -203,7 +203,7 @@ module Rodauth
|
|
203
203
|
end
|
204
204
|
|
205
205
|
if defined?(Rodauth::Model)
|
206
|
-
Rodauth::Model.register_association(:
|
206
|
+
Rodauth::Model.register_association(:omniauth) do
|
207
207
|
{ name: :identities, type: :many, table: omniauth_identities_table, key: omniauth_identities_id_column }
|
208
208
|
end
|
209
209
|
end
|
data/rodauth-omniauth.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |spec|
|
2
2
|
spec.name = "rodauth-omniauth"
|
3
|
-
spec.version = "0.3.
|
3
|
+
spec.version = "0.3.2"
|
4
4
|
spec.authors = ["Janko Marohnić"]
|
5
5
|
spec.email = ["janko@hey.com"]
|
6
6
|
|
@@ -29,4 +29,5 @@ Gem::Specification.new do |spec|
|
|
29
29
|
spec.add_development_dependency "capybara"
|
30
30
|
spec.add_development_dependency "jwt"
|
31
31
|
spec.add_development_dependency "rodauth-i18n"
|
32
|
+
spec.add_development_dependency "rodauth-model"
|
32
33
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rodauth-omniauth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Janko Marohnić
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-03-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rodauth
|
@@ -164,6 +164,20 @@ dependencies:
|
|
164
164
|
- - ">="
|
165
165
|
- !ruby/object:Gem::Version
|
166
166
|
version: '0'
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: rodauth-model
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - ">="
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '0'
|
174
|
+
type: :development
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - ">="
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: '0'
|
167
181
|
description: Rodauth extension for logging in and creating account via OmniAuth authentication.
|
168
182
|
email:
|
169
183
|
- janko@hey.com
|
@@ -198,7 +212,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
198
212
|
- !ruby/object:Gem::Version
|
199
213
|
version: '0'
|
200
214
|
requirements: []
|
201
|
-
rubygems_version: 3.
|
215
|
+
rubygems_version: 3.4.7
|
202
216
|
signing_key:
|
203
217
|
specification_version: 4
|
204
218
|
summary: Rodauth extension for logging in and creating account via OmniAuth authentication.
|