zaikio-oauth_client 0.6.1 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +14 -1
- data/lib/zaikio/oauth_client/authenticatable.rb +5 -3
- data/lib/zaikio/oauth_client/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bf62363ad03a5a1e7c6ee7e6be3100efcb32b1d45ecabe5858da1b2f558b3dcf
|
4
|
+
data.tar.gz: a5f650f66dd13fa05d9d63999fc2d5327d65ecea99c8f895821819f8a6181f60
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 58ebc73778fba84f9eae327d8b4250fee238311594340bec36ef04e90c14859fb2ac912df9f2dae37152646075221ac2a07adba3a254ad238bdae9a1089a667f
|
7
|
+
data.tar.gz: a8e4820c7b981f6e9249f667e4c99dccd7f4c2f96d2c42192b87a73409f2fb67decba6e01e36fd3586ae749e819c9869e7a5a9711f5843df7d5d97acd6344ce0
|
data/README.md
CHANGED
@@ -103,7 +103,20 @@ redirect_to zaikio_oauth_client.new_session_path(client_name: 'my_other_client')
|
|
103
103
|
redirect_to zaikio_oauth_client.new_connection_path(client_name: 'my_other_client')
|
104
104
|
```
|
105
105
|
|
106
|
-
This will redirect the user to the OAuth Authorize endpoint of the Zaikio Directory
|
106
|
+
This will redirect the user to the OAuth Authorize endpoint of the Zaikio Directory
|
107
|
+
`.../oauth/authorize` and include all necessary parameters like your client_id. You may
|
108
|
+
also pass `show_signup`, `force_login` and `state` parameters through, like so:
|
109
|
+
|
110
|
+
```ruby
|
111
|
+
# Take the user directly to the signup page
|
112
|
+
redirect_to zaikio_oauth_client.new_session_path(show_signup: true)
|
113
|
+
|
114
|
+
# Force the user to re-authenticate even if they have an existing session
|
115
|
+
redirect_to zaikio_oauth_client.new_session_path(force_login: true)
|
116
|
+
|
117
|
+
# Pass a custom Oauth 2.0 state parameter
|
118
|
+
redirect_to zaikio_oauth_client.new_session_path(state: "something-my-app-uses")
|
119
|
+
```
|
107
120
|
|
108
121
|
#### Session handling
|
109
122
|
|
@@ -4,11 +4,13 @@ module Zaikio
|
|
4
4
|
extend ActiveSupport::Concern
|
5
5
|
|
6
6
|
def new
|
7
|
-
|
7
|
+
opts = params.permit(:client_name, :show_signup, :force_login, :state)
|
8
|
+
client_name = opts.delete(:client_name)
|
8
9
|
|
9
10
|
redirect_to oauth_client.auth_code.authorize_url(
|
10
|
-
redirect_uri: approve_url(
|
11
|
-
scope: oauth_scope
|
11
|
+
redirect_uri: approve_url(client_name),
|
12
|
+
scope: oauth_scope,
|
13
|
+
**opts
|
12
14
|
)
|
13
15
|
end
|
14
16
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zaikio-oauth_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Zaikio GmbH
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-03-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|