sqsc-keycloak-ruby 1.0.0 → 1.0.1
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/Gemfile.lock +1 -1
- data/README.md +3 -3
- data/lib/keycloak/version.rb +1 -1
- data/lib/sqsc-keycloak-ruby.rb +4 -0
- 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: 1a6e6ffe4d42fd40302fbaa10e4e00373576fbbd1aed495b09371bc37b7e09b3
|
|
4
|
+
data.tar.gz: 8947ad39d88f909278b601c03cdd756ff8517e18abacf3bacdc46fc5eccec72b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e3d04dfce599fb9c71249e717450552850cd5bb405101d70c4b27700486454ac34df133b9377b0b13eabfda3eab503a94ac583e5b52a53680255fb5ede0c0dc4
|
|
7
|
+
data.tar.gz: 66d0464de05084e71f7562dd47e17371a4b24bf4751c02b8cb5a3b9151e39ef3ba04875088aa43cb3a1afed8b44602b2c6b103f0c03cd37ac6c15c4f7362d548
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
|
@@ -137,21 +137,21 @@ The `Keycloak::Client` module has the methods that represent the <b>endpoint</b>
|
|
|
137
137
|
We will detail each of these methods:
|
|
138
138
|
|
|
139
139
|
```ruby
|
|
140
|
-
Keycloak::Client.get_token(user, password, client_id = '', secret = '')
|
|
140
|
+
Keycloak::Client.get_token(user, password, client_id = '', secret = '', scope = nil)
|
|
141
141
|
```
|
|
142
142
|
|
|
143
143
|
If you choose to authenticate users using the screen of your own application, then use this method. Simply invoke it in the method of login in the `controller` defined with the session controller of your application, passing as parameter the <b>user</b> and the <b>password</b> informed by the user. If the authentication is valid, then a JSON containing the `access_token` and the `refresh_token` is returned.
|
|
144
144
|
|
|
145
145
|
|
|
146
146
|
```ruby
|
|
147
|
-
Keycloak::Client.url_login_redirect(redirect_uri, response_type = 'code')
|
|
147
|
+
Keycloak::Client.url_login_redirect(redirect_uri, response_type = 'code', client_id = '', authorization_endpoint = '', scope = nil)
|
|
148
148
|
```
|
|
149
149
|
|
|
150
150
|
To authenticate the users of your application using a template configured in Keycloak, redirect the request to the url returned in this method. Pass as a parameter the url that the user will have access in case of successful authentication (`redirect_uri`) and also the type of response (`response_type`), which if not informed, gem will assume the `code` value. If the authentication is successful, then a `code` will be returned that will enable you to request a token from <b>Keycloak</b>.
|
|
151
151
|
|
|
152
152
|
|
|
153
153
|
```ruby
|
|
154
|
-
Keycloak::Client.get_token_by_code(code, redirect_uri, client_id = '', secret = '')
|
|
154
|
+
Keycloak::Client.get_token_by_code(code, redirect_uri, client_id = '', secret = '', scope = nil)
|
|
155
155
|
```
|
|
156
156
|
|
|
157
157
|
When using the `Keycloak::Client.url_login_redirect` method to get a `code`, pass it as a parameter in this method so that Keycloak returns a token, thus logging the user in the application. The second parameter (`redirect_uri`) must be passed so that when a token is made available, Keycloak redirects to the url informed.
|
data/lib/keycloak/version.rb
CHANGED
data/lib/sqsc-keycloak-ruby.rb
CHANGED
|
@@ -492,6 +492,10 @@ module Keycloak
|
|
|
492
492
|
generic_get("users/#{id}/role-mappings/clients/#{client}", nil, access_token)
|
|
493
493
|
end
|
|
494
494
|
|
|
495
|
+
def self.list_offline_session(client_id, access_token)
|
|
496
|
+
generic_get("clients/#{client_id}/offline-sessions", nil, access_token)
|
|
497
|
+
end
|
|
498
|
+
|
|
495
499
|
def self.update_effective_user_roles(id, client_id, roles_names, access_token = nil)
|
|
496
500
|
client = JSON get_clients({ clientId: client_id }, access_token)
|
|
497
501
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: sqsc-keycloak-ruby
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Guilherme Portugues
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: exe
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2019-12-
|
|
12
|
+
date: 2019-12-26 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: bundler
|