strongmind-auth 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 739e3ce6d5b6705f2079e7a24b572d21df94d8e3509a487a30f427ce22254713
4
- data.tar.gz: f338629c41d5ec042f11e8627d852fd388738fcbe0f4fd61d0fb085b20a2e380
3
+ metadata.gz: fa3b415850df2aa96fc700cdd6f9062a2b08bd45013b3cf0eed7daface29b249
4
+ data.tar.gz: f5b2460f7b9647a5ca78a077cb15fdd4ada4deec9283f4b13c25baee8cf4d1a1
5
5
  SHA512:
6
- metadata.gz: 1214dd5316b2402c75c41d10b74dce2cede5c639bcf72e84b78faf1de325b186d60bc57edd186678e14f4e26bf01f101334e37a317c95432e7d9854ed248be85
7
- data.tar.gz: 662dd22e6c058e7022e3a1f872ec097ab688019959afb030ac9529617c18771da14f2b4774c071729229d681e47706a97fa8f9e8cf77b641a7060e329c4d37dc
6
+ metadata.gz: a1e37eb6d57253077830cf3d34364708b3ea823272ed095ae54e348e51ecc3c1b868977c1e3e53afc2670cd98f526d8faa835e69c8f2ae25c864bf32239b0ac0
7
+ data.tar.gz: 65f17555dd2cad8787ab9855f424495311a9b289a87732a508f4e2b3d3a5a4384d05a9d6f03cb371a527e9087c55f80ae94f7370fcaaa284d8e4f2146e8ea700
data/README.md CHANGED
@@ -4,11 +4,16 @@ Ruby gem for authentication in a rails app
4
4
 
5
5
  ## Usage
6
6
 
7
- 1. `rails new app_name --css tailwind`
7
+ 1. `rails new app --css tailwind`
8
+ 1. `cd app`
8
9
  1. `bundle add strongmind-auth`
9
10
  1. `rails g strongmind:install`
10
- 1. Move app root to authenticated root in routes
11
- 1. Add `IDENTITY_CLIENT_ID` and `IDENTITY_CLIENT_SECRET` values to .env
12
- 1. `bundle`
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.
13
18
  1. `rails dev:cache`
14
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: %i[openid profile],
283
+ scope: scopes,
282
284
  response_type: :code,
283
285
  issuer: identity_base_url,
284
286
  discovery: true,
@@ -1,4 +1,8 @@
1
1
  IDENTITY_CLIENT_ID=
2
2
  IDENTITY_CLIENT_SECRET=
3
+
4
+ # Space delimited list of scopes
5
+ IDENTITY_SCOPES=
6
+
3
7
  IDENTITY_BASE_URL=https://devlogin.strongmind.com
4
8
  APP_BASE_URL=http://localhost:3000
@@ -1,5 +1,5 @@
1
1
  module Strongmind
2
2
  module Auth
3
- VERSION = "1.0.2"
3
+ VERSION = "1.0.3"
4
4
  end
5
5
  end
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.2
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-12 00:00:00.000000000 Z
11
+ date: 2024-03-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails