strongmind-auth 1.0.1 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +11 -10
- data/config/initializers/devise.rb +3 -1
- data/lib/generators/strongmind/install_generator.rb +1 -1
- data/lib/generators/strongmind/templates/env +8 -0
- data/lib/strongmind/auth/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa3b415850df2aa96fc700cdd6f9062a2b08bd45013b3cf0eed7daface29b249
|
4
|
+
data.tar.gz: f5b2460f7b9647a5ca78a077cb15fdd4ada4deec9283f4b13c25baee8cf4d1a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a1e37eb6d57253077830cf3d34364708b3ea823272ed095ae54e348e51ecc3c1b868977c1e3e53afc2670cd98f526d8faa835e69c8f2ae25c864bf32239b0ac0
|
7
|
+
data.tar.gz: 65f17555dd2cad8787ab9855f424495311a9b289a87732a508f4e2b3d3a5a4384d05a9d6f03cb371a527e9087c55f80ae94f7370fcaaa284d8e4f2146e8ea700
|
data/README.md
CHANGED
@@ -4,15 +4,16 @@ Ruby gem for authentication in a rails app
|
|
4
4
|
|
5
5
|
## Usage
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
1. `rails new app_name --tailwind`
|
12
|
-
1. Add strongmind-auth to gem file and bundle
|
7
|
+
1. `rails new app --css tailwind`
|
8
|
+
1. `cd app`
|
9
|
+
1. `bundle add strongmind-auth`
|
13
10
|
1. `rails g strongmind:install`
|
14
|
-
1. Move app root to authenticated root in routes
|
15
|
-
|
16
|
-
|
11
|
+
1. Move app root to authenticated root in routes. Should look like this:
|
12
|
+
```ruby
|
13
|
+
authenticated :user do
|
14
|
+
root to: 'home#index' # or whatever makes sense for your app
|
15
|
+
end
|
16
|
+
```
|
17
|
+
1. Create a new client in identity server and `IDENTITY_CLIENT_ID` and `IDENTITY_CLIENT_SECRET` values to .env file.
|
17
18
|
1. `rails dev:cache`
|
18
|
-
1. `bin/dev`
|
19
|
+
1. `bin/dev`
|
@@ -276,9 +276,11 @@ Devise.setup do |config|
|
|
276
276
|
# config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo'
|
277
277
|
identity_base_url = ENV['IDENTITY_BASE_URL'] || "https://devlogin.strongmind.com"
|
278
278
|
app_base_url = ENV['APP_BASE_URL'] || "http://localhost:3000"
|
279
|
+
scopes = %i[openid profile offline_access]
|
280
|
+
scopes = scopes + ENV['IDENTITY_SCOPES'].split(' ').map(&:to_sym) if ENV['IDENTITY_SCOPES'].present?
|
279
281
|
config.omniauth :openid_connect, {
|
280
282
|
name: :strongmind,
|
281
|
-
scope:
|
283
|
+
scope: scopes,
|
282
284
|
response_type: :code,
|
283
285
|
issuer: identity_base_url,
|
284
286
|
discovery: true,
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: strongmind-auth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Team Belding
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-03-
|
11
|
+
date: 2024-03-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -118,6 +118,7 @@ files:
|
|
118
118
|
- lib/generators/strongmind/USAGE
|
119
119
|
- lib/generators/strongmind/install_generator.rb
|
120
120
|
- lib/generators/strongmind/templates/add_uid_to_user.rb
|
121
|
+
- lib/generators/strongmind/templates/env
|
121
122
|
- lib/generators/strongmind/templates/user.rb
|
122
123
|
- lib/strongmind/auth.rb
|
123
124
|
- lib/strongmind/auth/engine.rb
|