omniauth-edlink 0.1.0 → 0.2.0

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: 4a569bc748df142608c58c8481069a90ea3edceb13f7e2e107091de16507bc8f
4
- data.tar.gz: '0960b368cf2fe33a37528f3c939ee19fd68fe6311077a0c4b07d026266617ee3'
3
+ metadata.gz: c03f09095c79e90de774f936dca9d726269445970cf96f090441a69ad25074da
4
+ data.tar.gz: dc21632edffeabefa2461bd6eaf5a85e3ef4418b45e52ef515689b90083c31ce
5
5
  SHA512:
6
- metadata.gz: db791e6fcfa1efd880f0f92e0c064680fc979baf8945c2ed3eec3f545362dfa377dd94af186ad66b1fb0f045269c0009e1f90671f2a115b8251b9426d6b1c0de
7
- data.tar.gz: d916c1d12c735ffcae933f8f134a90abde9a485b0bdb93effd6349f1f7b10ccd1bb13f2b08f5895e79546e5bd06de1b7de141f1cd6b3e76261486692ace9fc6e
6
+ metadata.gz: 831df80a6be58b2ed2c924f3db08f5cf76756cd817d42c39c3063cddceb551d7b96c34c3cc01f0389f17a3f078b3bc499a2e2a7a8d713b3c598abd0aba42634e
7
+ data.tar.gz: 7fd816f3e7b426680add1369102edaefc35d056d4384a8534b8ab79b8d162af0b9333fcea2737b282df609928f3aa5b3166a33e67eb4dd04f37369d9f07f0752
data/.gitignore CHANGED
@@ -1 +1,2 @@
1
- .idea/
1
+ .idea/
2
+ omniauth-edlink-*.gem
data/CHANGELOG.md ADDED
@@ -0,0 +1,10 @@
1
+ # Changelog
2
+ All notable changes to this project will be documented in this file.
3
+
4
+ ## 0.2.0
5
+
6
+ * Support optional integration_id parameter that redirect users directly to IdP login page.
7
+
8
+ ## 0.1.0
9
+
10
+ * Initial release.
data/README.md CHANGED
@@ -37,6 +37,12 @@ Or, alternatively, if you use [Devise](https://github.com/plataformatec/devise),
37
37
  'your-edlink-secret-key'
38
38
  ```
39
39
 
40
+ If for some reason you know the Edlink's integration id for a particular SSO request (e.g. from your application subdomain or from typed email address) and you want to take your users directly to their upstream SSO login page instead of generic Edlink login page, you can pass additional `integration_id` parameter to the redirect request, e.g.:
41
+ ```ruby
42
+ redirect_to "/auth/edlink?integration_id=#{integration_id}"
43
+ ```
44
+ This will redirect the user to the Edlink's SSO login page for the specified integration id.
45
+
40
46
  # Contributing
41
47
  1. Fork it
42
48
  2. Create your feature branch (git checkout -b my-new-feature)
@@ -1,5 +1,5 @@
1
1
  module Omniauth
2
2
  module Edlink
3
- VERSION = '0.1.0'.freeze
3
+ VERSION = '0.2.0'.freeze
4
4
  end
5
5
  end
@@ -26,6 +26,12 @@ module OmniAuth
26
26
  raw_info[options.uid_field.to_s]
27
27
  end
28
28
 
29
+ def request_phase
30
+ integration_id = request.params['integration_id']
31
+ authorize_path = integration_id.present? ? integration_authorize_path(integration_id) : options.client_options.authorize_url
32
+ redirect client.connection.build_url(URI.join(options.client_options.site, authorize_path), authorize_params)
33
+ end
34
+
29
35
  def authorize_params
30
36
  super.tap do |params|
31
37
  params[:scope] = [:email, :profile]
@@ -50,6 +56,10 @@ module OmniAuth
50
56
  def callback_url
51
57
  full_host + callback_path
52
58
  end
59
+
60
+ def integration_authorize_path(integration_id)
61
+ "/api/authentication/integrations/#{integration_id}/launch"
62
+ end
53
63
  end
54
64
  end
55
65
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-edlink
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kamil Bednarz
8
8
  - Tomasz Rosiek
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2024-07-22 00:00:00.000000000 Z
12
+ date: 2024-07-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: omniauth-oauth2
@@ -34,6 +34,7 @@ extensions: []
34
34
  extra_rdoc_files: []
35
35
  files:
36
36
  - ".gitignore"
37
+ - CHANGELOG.md
37
38
  - Gemfile
38
39
  - Gemfile.lock
39
40
  - LICENSE
@@ -46,7 +47,7 @@ homepage: https://github.com/u2i/omniauth-edlink
46
47
  licenses:
47
48
  - Apache-2.0
48
49
  metadata: {}
49
- post_install_message:
50
+ post_install_message:
50
51
  rdoc_options: []
51
52
  require_paths:
52
53
  - lib
@@ -61,8 +62,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
61
62
  - !ruby/object:Gem::Version
62
63
  version: '0'
63
64
  requirements: []
64
- rubygems_version: 3.1.6
65
- signing_key:
65
+ rubygems_version: 3.4.10
66
+ signing_key:
66
67
  specification_version: 4
67
68
  summary: The unofficial strategy for authenticating users using ed.link using OAuth2
68
69
  provider