keycloak 2.3.0 → 2.3.1

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: bed7a57a922cce701d2a97abfe58dc2a9424a6744bf9756f2abdc99e0f8fe9a4
4
- data.tar.gz: c133a6162ad571e0e224145524430991e94d09333f24a8cc40302b48562087bf
3
+ metadata.gz: 6f5e81b426ef2ccd31a7278d771cbd5489d777412b5bb5480b0e467847b35bd7
4
+ data.tar.gz: 90e7de6277c9b58402219f4964bb29a12390234ef52073e941489a64ba57d09f
5
5
  SHA512:
6
- metadata.gz: d123f765a14329ac0078f14b252563b34b8955abc63b1c65aa2a466fc2382fc3d7eb0ecf158e08362c96bea3c81d0244b28df2ece20faf92280193840f5c855e
7
- data.tar.gz: 785c56cfce98cf957c2c83a16143599e226ddf521d0fbaa629413f1bd9bb95f1072f3e753c19cbac8aa5d931ed2942d4f269f9a2c542f60411d4794e65824d84
6
+ metadata.gz: eb26009073f1ba875c014d2aacfb0ef952d9c2dbaa4533b33ad059a65c2f953c7610d792d80d200614edca306f0a38ec6f0b38b756cf558e9601bea0029f014c
7
+ data.tar.gz: 3524e51b85b93b154bedc781598216fbe6713c5a7a3b42931dc14b0ee7365053d3b2587f1f736d9e789cd42453f3a35a488fa4eeb365acd97d95fe7313c455c9
data/Gemfile.lock ADDED
@@ -0,0 +1,55 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ keycloak (2.3.1)
5
+ json
6
+ jwt
7
+ rest-client
8
+
9
+ GEM
10
+ remote: https://rubygems.org/
11
+ specs:
12
+ diff-lcs (1.3)
13
+ domain_name (0.5.20170404)
14
+ unf (>= 0.0.5, < 1.0.0)
15
+ http-cookie (1.0.3)
16
+ domain_name (~> 0.5)
17
+ json (2.1.0)
18
+ jwt (2.1.0)
19
+ mime-types (3.1)
20
+ mime-types-data (~> 3.2015)
21
+ mime-types-data (3.2016.0521)
22
+ netrc (0.11.0)
23
+ rake (10.5.0)
24
+ rest-client (2.0.2)
25
+ http-cookie (>= 1.0.2, < 2.0)
26
+ mime-types (>= 1.16, < 4.0)
27
+ netrc (~> 0.8)
28
+ rspec (3.7.0)
29
+ rspec-core (~> 3.7.0)
30
+ rspec-expectations (~> 3.7.0)
31
+ rspec-mocks (~> 3.7.0)
32
+ rspec-core (3.7.1)
33
+ rspec-support (~> 3.7.0)
34
+ rspec-expectations (3.7.0)
35
+ diff-lcs (>= 1.2.0, < 2.0)
36
+ rspec-support (~> 3.7.0)
37
+ rspec-mocks (3.7.0)
38
+ diff-lcs (>= 1.2.0, < 2.0)
39
+ rspec-support (~> 3.7.0)
40
+ rspec-support (3.7.1)
41
+ unf (0.1.4)
42
+ unf_ext
43
+ unf_ext (0.0.7.5)
44
+
45
+ PLATFORMS
46
+ ruby
47
+
48
+ DEPENDENCIES
49
+ bundler (~> 1.15)
50
+ keycloak!
51
+ rake (~> 10.0)
52
+ rspec (~> 3.0)
53
+
54
+ BUNDLED WITH
55
+ 1.16.1
data/README.md CHANGED
@@ -1,217 +1,236 @@
1
1
  # Keycloak
2
- A gem Keycloak foi desenvolvida para integrar aplicações e serviços ao sistema [Keycloak](http://www.keycloak.org/) da [Red Hat](https://www.redhat.com) para controle de usuários, autenticação, autorização e sessão.
3
2
 
4
- O seu desenvolvimento foi baseado na versão 3.2 do Keycloak, cuja documentação pode ser encontrada [aqui](http://www.keycloak.org/archive/documentation-3.2.html).
3
+ * [pt-BR translation](https://github.com/imagov/keycloak/blob/master/README.pt-BR.md)
5
4
 
6
- Publicação da gem: https://rubygems.org/gems/keycloak
5
+ Keycloak gem was developed to integrate applications and services into [Red Hat](https://www.redhat.com)'s [Keycloak](http://www.keycloak.org/) system for user control, authentication, authorization, and session management.
7
6
 
8
- ## Instalação
7
+ Its development was based on version 3.2 of Keycloak, whose documentation can be found [here](http://www.keycloak.org/archive/documentation-3.2.html).
9
8
 
10
- Adicione esta linha no <b>Gemfile</b> de sua aplicação:
9
+ Publication of gem: https://rubygems.org/gems/keycloak
10
+
11
+ ## Installation
12
+
13
+ Add this line in your application's <b>gemfile</b>:
11
14
 
12
15
  ```ruby
13
16
  gem 'keycloak'
14
17
  ```
15
18
 
16
- Então execute:
19
+ Install the gem by running:
17
20
 
18
- $ bundle
21
+ $ bundle install
19
22
 
20
- Ou instale você mesmo:
23
+ Or install it yourself:
21
24
 
22
25
  $ gem install keycloak
26
+
27
+ To add the configuration file:
23
28
 
24
- Para adicionar seu arquivo de configuração:
25
-
26
- $ rails generate initializer
29
+ $ rails generate initializer
27
30
 
28
- ## Utilização
31
+
32
+ ## Use
29
33
 
30
- Considerando que você possua um ambiente do Keycloak configurado e a gem instalada, o próximo passo é definir como será a autenticação da aplicação. O Keycloak trabalha com os principais protocolos de autenticação, tais como o OpenID Connect, Oauth 2.0 e SAML 2.0, integrando acesso a sistemas via Single-Sign On, podendo inclusive disponibilizar acessos a usuários LDAP ou Active Directory.
34
+ Since you already have a Keycloak environment configured and the gem already installed, the next step is to define how the application will authenticate. Keycloak works with key authentication protocols, such as OpenID Connect, Oauth 2.0 and SAML 2.0, integrating system access through Single-Sign On, and can also provide access to <b>LDAP</b> or <b>Active Directory</b> users.
31
35
 
32
- Ao cadastrar um Reino e também um Client no seu ambiente Keycloak, será necessário fazer o download do arquivo de instalação do Client para dentro da pasta raiz da aplicação, para que a gem obtenha as informações necessárias para interagir com o Keycloak. Para fazer esse download, basta acessar o cadastro de seu Client, clicar na aba <b>Installation</b>, selecionar <b>Keycloak OIDC JSON</b> no campo <b>Format option</b> e clicar em <b>Download</b>.
36
+ When you register a realm and also a Client in your Keycloak environment, you can download the Client installation file into the root folder of the application so that gem gets the information it needs to interact with Keycloak. To download this, simply access your Client's registry, click the <b>Installation</b> tab, select <b>Keycloak OIDC JSON</b> in the <b>Format option</b> field and click <b>Download</b>. If your application does not only work with a specific client (application server for APIs, for example), then you can tell what is the realm that gem will interact in the `keycloak.rb` configuration file.
33
37
 
34
- A gem possui um módulo principal chamado <b>Keycloak</b>. Dentro desse módulo três outros módulos: <b>Client</b>, <b>Admin</b> e <b>Internal</b>.
38
+ Gem has a main module called <b>Keycloak</b>. Within this module there are three other modules: <b>Client</b>, <b>Admin</b> and <b>Internal</b>.
35
39
 
36
40
  ### Module Keycloak
37
41
 
38
- O módulo Keycloak possui alguns atributos e suas definições são fundamentais para o perfeito funcionamento da gem na aplicação.
42
+ The Keycloak module has some attributes and its definitions are fundamental for the perfect functioning of the gem in the application.
43
+
44
+ ```ruby
45
+ Keycloak.realm
46
+ ```
47
+
48
+ If your application does not only work with a specific client (application server for APIs, for example), then you can tell the realm name that gem will interact in that attribute. When installed, gem creates the `keycloak.rb` file in `config / initializers`. This attribute can be found and defined in this file.
49
+
50
+
51
+ ```ruby
52
+ Keycloak.auth_server_url
53
+ ```
54
+
55
+ For the same scenario as the above attribute, you can tell the url of the realm that the gem will interact in that attribute. When installed, gem creates the `keycloak.rb` file in `config / initializers`. This attribute can be found and defined in this file.
56
+
39
57
 
40
58
  ```ruby
41
59
  Keycloak.proxy
42
60
  ```
43
61
 
44
- Caso o ambiente onde a sua aplicação será utilizada exija a utilização de proxy para o consumo das APIs do Keycloak, então defina-o neste atributo. Ao ser instalada, a gem cria o arquivo `keycloak.rb` em `config/initializers`. Este atributo pode ser encontrado e definido nesse arquivo.
62
+ If the environment where your application will be used requires the use of proxy for the consumption of the Keycloak APIs, then define it in this attribute. When it is installed, gem creates the `keycloak.rb` file in `config/initializers`. This attribute can be found and defined in this file.
63
+
45
64
 
46
65
  ```ruby
47
66
  Keycloak.generate_request_exception
48
67
  ```
49
68
 
50
- Este atributo serve para definir se as exceções HTTP geradas nos retornos das requisições feitas para o Keycloak serão ou não estouradas na aplicação. Caso definido como `false`, então a exceção não será estourada e a resposta HTTP será retornada para a aplicação fazer o seu próprio tratamento. O valor default deste atributo é `true`. Ao ser instalada, a gem cria o arquivo `keycloak.rb` em `config/initializers`. Este atributo pode ser encontrado e definido nesse arquivo.
69
+ This attribute is to define whether the HTTP exceptions generated in the returns of the requests made to Keycloak will or will not burst in the application. If set to `false`, then the exception will not be blown and the HTTP response will be returned to the application to do its own processing. The default value of this attribute is `true`. When it is installed, gem creates the `keycloak.rb` file in `config/initializers`. This attribute can be found and defined in this file.
51
70
 
52
71
 
53
72
  ```ruby
54
73
  Keycloak.keycloak_controller
55
74
  ```
56
75
 
57
- É recomendado que a sua aplicação possua um controller que centraliza as ações de sessão que o Keycloak irá gerenciar, tais como a ação de login, logout, atualização de sessão, reset de senha, entre outras. Defina neste atributo qual é o nome do controller que desempenhará esse papel. Se o nome do seu controller é `SessionController`, então o valor deste atributo deverá ser apenas `session`. Ao ser instalada, a gem cria o arquivo `keycloak.rb` em `config/initializers`. Este atributo pode ser encontrado e definido nesse arquivo.
76
+ It is recommended that your application has a controller that centralizes the session actions that Keycloak will manage, such as login action, logout, session update, password reset, among others. Define in this attribute what is the name of the controller that will play this role. If your controller name is `SessionController`, then the value of this attribute should be `session` only. When it is installed, gem creates the `keycloak.rb` file in `config/initializers`. This attribute can be found and defined in this file.
58
77
 
59
78
 
60
79
  ```ruby
61
80
  Keycloak.proc_cookie_token
62
81
  ```
63
82
 
64
- Este atributo trata-se de um método anônimo (lambda). O mesmo deve ser implementado na aplicação para que a gem tenha acesso ao token de autenticação que, por sua vez, deverá ser armazenado no cookie. Ao realizar a autenticação no keycloak através da gem, o sistema deverá armazenar o token retornado no cookie do browser, como por exemplo:
83
+ This attribute is an anonymous method (lambda). The same must be implemented in the application so that the gem has access to the authentication token which, in turn, must be stored in the cookie. When performing the keycloak authentication through gem, the system must store the token returned in the browser cookie, such as:
65
84
  ```ruby
66
85
  cookies.permanent[:keycloak_token] = Keycloak::Client.get_token(params[:user_login], params[:user_password])
67
86
  ```
68
- A aplicação poderá recuperar o token no cookie implementando o método `Keycloak.proc_cookie_token` da seguinte forma:
87
+
88
+ The application can retrieve the token in the cookie by implementing the `Keycloak.proc_cookie_token` method as follows:
69
89
  ```ruby
70
90
  Keycloak.proc_cookie_token = -> do
71
91
  cookies.permanent[:keycloak_token]
72
92
  end
73
93
  ```
74
- Desta forma, todas as vezes que a gem precisar utilizar as informações do token para consumir um serviço do Keycloak, ele irá invocar este método lambda.
94
+ This way, every time gem needs to use the token information to consume a Keycloak service, it will invoke this lambda method.
75
95
 
76
96
 
77
97
  ```ruby
78
98
  Keycloak.proc_external_attributes
79
99
  ```
80
100
 
81
- O Keycloak a possibilidade de que novos atributos sejam mapeados no cadastro de usuários. Porém, quando esses atributos são específicos da aplicação, recomenda-se que a própria os gerencie. Para isso, a melhor solução é criar esses atributos na aplicação - exemplo: criar uma tabela no banco de dados da própria aplicação contendo as colunas representando cada um dos atributos, inserindo também nessa tabela uma coluna de identificação única (unique key), contendo na mesma o Id do usuário criado no Keycloak, indicando que esse pertencente àquele Id possui aqueles atributos.
82
- Para que a gem tenha acesso a esses atributos, defina o atributo`Keycloak.proc_external_attributes` com um método lambda obtendo do `model` os atributos do usuário logado. Exemplo:
101
+ Keycloak gives the possibility that new attributes are mapped to the user registry. However, when these attributes are application specific, it is recommended that you manage them yourself. To do this, the best solution is to create these attributes in the application - example: create a table in the database of the application itself containing the columns representing each of the attributes, also inserting in this table a unique key column, same as the User Id created in Keycloak, indicating that the one belonging to that Id has those attributes.
102
+ In order for gem to have access to these attributes, set the `Keycloak.proc_external_attributes` attribute to a lambda method by obtaining the attributes of the logged-in user. Example:
83
103
  ```ruby
84
104
  Keycloak.proc_external_attributes = -> do
85
- atributos = UsuariosAtributo.find_or_create_by(user_keycloak_id: Keycloak::Client.get_attribute('sub'))
86
- if atributos.status.nil?
87
- atributos.status = false
88
- atributos.save
105
+ attribute = UsuariosAtributo.find_or_create_by(user_keycloak_id: Keycloak::Client.get_attribute('sub'))
106
+ if attribute.status.nil?
107
+ attribute.status = false
108
+ attribute.save
89
109
  end
90
- atributos
110
+ attribute
91
111
  end
92
112
  ```
93
113
 
94
- <b>Observação:</b> Os atributos `Keycloak.proc_cookie_token` e `Keycloak.proc_external_attributes` podem ser definidos no `initialize` do controller `ApplicationController`.
95
114
 
115
+ <b>Note:</b> The `Keycloak.proc_cookie_token` and `Keycloak.proc_external_attributes` attributes can be defined in the `initialize` of the controller `ApplicationController`.
96
116
 
97
- ### Keycloak::Client
98
117
 
99
- O módulo `Keycloak::Client` possui os métodos que representam os serviços de <b>endpoints</b>. Esses serviços são fundamentais para a criação e atualização de tokens, efetuação de login e logout, e, também para a obtenção de informações sintéticas de um usuário logado. O que habilita a gem a fazer uso de todos esses serviços é o arquivo de instalação do client citado anteriormente.
118
+ ### Keycloak::Client
100
119
 
101
- Vamos ao detalhamento de cada um desses métodos:
120
+ The `Keycloak::Client` module has the methods that represent the <b>endpoint</b> services. These services are fundamental for creating and updating tokens, logging in and logout, and also for obtaining the synthetic information of a logged in user. What enables gem to make use of all these services is the previously mentioned client installation file.
102
121
 
122
+ We will detail each of these methods:
103
123
 
104
124
  ```ruby
105
125
  Keycloak::Client.get_token(user, password)
106
126
  ```
107
127
 
108
- Caso você opte por efetuar a autenticação dos usuários utilizando a tela da sua própria aplicação, então utilize esse método. Basta invocá-lo no método de login no `controller` definido com o controlador de sessão de sua aplicação, passando como parâmetro o <b>usuário</b> e a <b>senha</b> informados pelo usuário. Caso a autenticação seja válida, então será retornado um JSON contendo entre as informações principais o `access_token` e o `refresh_token`.
128
+ 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.
109
129
 
110
130
 
111
131
  ```ruby
112
132
  Keycloak::Client.url_login_redirect(redirect_uri, response_type = 'code')
113
133
  ```
114
134
 
115
- Para efetuar a autenticação dos usuários de sua aplicação utilizando um template configurado no Keycloak, redirecione a requisição para a url retornada nesse método. Passe como parâmetro a url que o usuário terá acesso no caso de êxito na autenticação(`redirect_uri`) e também o tipo de resposta (`response_type`), que caso não informado, a gem assumirá o valor `code`. Caso a autenticação seja bem sucedida, então será retornado um `code` que te habilitará a requisitar um token ao Keycloak.
135
+ 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>.
116
136
 
117
137
 
118
138
  ```ruby
119
139
  Keycloak::Client.get_token_by_code(code, redirect_uri)
120
140
  ```
121
141
 
122
- Ao utilizar o método `Keycloak::Client.url_login_redirect` para obter um `code`, passe-o como parâmetro neste método para que o Keycloak retorne um token, efetuando assim o login do usuário na aplicação. O segundo parâmetro (`redirect_uri`) deve ser passado para que, ao disponibilizar um token, o Keycloak redirecione para a url informada.
142
+ 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.
123
143
 
124
144
 
125
145
  ```ruby
126
146
  Keycloak::Client.get_token_by_refresh_token(refresh_token = '')
127
147
  ```
128
148
 
129
- Quando o usuário estiver logado e a sua aplicação acompanhar internamente o tempo de expiração do token fornecido pelo Keycloak, então esse método poderá ser utilizado para a renovação desse token, caso o mesmo ainda seja válido. Para isso, basta passar como parãmetro o `refresh_token`. Caso não seja informado o `refresh_token`, a gem utilizará o `refresh_token` armazenado no cookie.
149
+ When the user is already logged in and your application internally tracks the token expiration time provided by Keycloak, then this method can be used to renew that token if it is still valid. To do this, simply pass the `refresh_token` as a parameter. If you do not inform `refresh_token`, gem will use the `refresh_token` stored in the cookie.
130
150
 
131
151
 
132
152
  ```ruby
133
153
  Keycloak::Client.get_token_introspection(token = '')
134
154
  ```
135
155
 
136
- Esse método retorna a as informações da sessão do `token` passado como parâmetro. Entre as informações retornadas, a mais importante é o campo `active`, pois ele informa se a sessão do token passado no parâmetro é ativo ou não. Isso auxiliará a sua aplicação a controlar se a sessão do usuário logado expirou ou não. Caso nenhum token seja passado como parâmetro, a gem utilizará o último `access_token` armazenado no cookie da aplicação.
156
+ This method returns the information from the `token` session passed as parameter. Among the information returned, the most important is the `active` field, since it informs whether the token session passed in the parameter is active or not. This will help your application control whether the logged-in user session has expired or not. If no token is passed as a parameter, gem will use the last `access_token` stored in the application's cookie.
137
157
 
138
158
 
139
159
  ```ruby
140
160
  Keycloak::Client.get_token_by_client_credentials(client_id = '', secret = '')
141
161
  ```
142
162
 
143
- alguns serviços do Keycloak como <b>reset de senha</b>, <b>cadastro de usuário</b> na tela inicial da aplicação ou até mesmo autenticação seguindo o padrão <b>OAuth 2.0</b>, que a autenticação de um usuário torna-se desnecessária. Sendo assim, podemos obter um token utilizando as credenciais da sua própria aplicação (Client) cadastrada no Keycloak. Para obter esse token, deve-se passar como parâmetro desse método o `client_id` - informado pela pessoa que cadastrou sua aplicação no Keycloak - e a `secret` de sua aplicação gerado pelo Keycloak - para gerar uma `secret`, o <b>Access Type</b> do seu Client (Aplicação) deverá estar configurado como `confidential`. Caso você não passe nenhum desses parâmetros, a gem utilizará as credenciais contidas no arquivo de instalação citado anteriormente.
163
+ There are some Keycloak services like <b>password reset</b>, <b>user registration</b> in the initial screen of the application or even authentication following the standard <b>OAuth 2.0</b>, that the authentication of a user becomes unnecessary. Therefore, we can obtain a token using the credentials of its own application (Client) registered in Keycloak. To obtain this token, pass the `client_id` - informed by the person who registered your application in Keycloak - and the `secret` of your application generated by Keycloak - to generate a `secret`, the Access Type of your Client must be configured as `confidential`. If you do not pass any of these parameters, gem will use the credentials contained in the installation file mentioned above.
144
164
 
145
165
 
146
166
  ```ruby
147
167
  Keycloak::Client.logout(redirect_uri = '', refresh_token = '')
148
168
  ```
149
169
 
150
- Quando utilizado antes da expiração da sessão do usuário logado, esse método encerra a sessão. Se o parâmetro `redirect_uri` for alimentado, então o Keycloak redirecionará a sua aplicação para a url informada após a efetuação do logout. O segundo parâmetro é o `refresh_token` obtido no momento da autenticação ou da atualização da sessão. Caso este último não seja informado, então a gem utilizará o `refresh_token` do cookie.
170
+ When used before the expiration of the logged on user's session, this method terminates the session. If the `redirect_uri` parameter is fed, then Keycloak will redirect your application to the url informed after logout. The second parameter is `refresh_token`, obtained at the time of authentication or session update. If the latter is not informed, then the gem will use the `refresh_token` of the cookie
151
171
 
152
172
 
153
173
  ```ruby
154
174
  Keycloak::Client.get_userinfo(access_token = '')
155
175
  ```
156
176
 
157
- Esse método retorna informações sintéticas do usuário representado pelo `access_token` passado como parâmetro, tais como `sub` - que é o Id do usuário autenticado -, `preferred_username` - que é o nome do usuário autenticado - e `email` - que é o e-mail do usuário. Caso o parâmetro `access_token` não seja informado, então a gem obterá essa informação no cookie.
177
+ This method returns synthetic information from the user represented by the `access_token` passed as a parameter, such as `sub` - which is the authenticated user id -, `preferred_username` - which is the authenticated user name - and `email` - which is the user's email address. If the `access_token` parameter is not informed, then the gem will get this information in the cookie.
158
178
 
159
179
 
160
180
  ```ruby
161
181
  Keycloak::Client.url_user_account
162
182
  ```
163
183
 
164
- Retorna a <b>url</b> para acesso ao cadastro de usuários do Reino do arquivo de instalação (`keycloak.json`). Para ter acesso a tela, o Keycloak exigirá a autenticação do usuário. Após logado, e caso tenha permissão, o usuário terá acesso a suas informações cadastrais podendo inclusive alterá-las.
184
+ Returns the <b>url</b> for access to the realm user registry of the installation file (`keycloak.json`). To access the screen, Keycloak will require user authentication. After connected, and if has permission, the user will have access to his own personal information and could even change them.
165
185
 
166
186
 
167
187
  ```ruby
168
188
  Keycloak::Client.has_role?(user_role, access_token = '')
169
189
  ```
170
190
 
171
- O método `has_role?` decodifica o JWT `access_token` e verifica se o usuário dono do token possui o <b>role</b> informado no parâmetro `user_role`. Caso o `access_token` não seja informado, então a gem utilizará o `access_token` do cookie.
191
+ The `has_role?` method decodes the JWT `access_token` and verifies that the user who owns the token has the <b>role</b> informed in the `user_role` parameter. If `access_token` is not informed then gem will use the `access_token` of the cookie.
172
192
 
173
193
 
174
194
  ```ruby
175
195
  Keycloak::Client.user_signed_in?(access_token = '')
176
196
  ```
177
197
 
178
- Esse método verifica se o `access_token` passado no parâmetro ainda está ativo. Para verificar se o usuário está ativo ou não, internamente a gem invoca o método `get_token_introspection`. Caso o `access_token` não seja informado, então a gem utilizará o `access_token` do cookie.
198
+ This method checks whether the `access_token` passed in the parameter is still active. To check whether the user is active or not, the gem invokes the `get_token_introspection` method internally. If `access_token` is not informed then gem will use the `access_token` of the cookie.
179
199
 
180
200
 
181
201
  ```ruby
182
202
  Keycloak::Client.get_attribute(attribute_name, access_token = '')
183
203
  ```
184
204
 
185
- Esse método decodifica o JWT `access_token` e retorna o valor do atributo de nome passado no parâmetro `attribute_name`. Esse atributo pode ser um <b>mapper</b> - cadastrado na seção <b>Mappers</b> do cadastro do <b>Client</b> do Reino. Caso o `access_token` não seja informado, então a gem utilizará o `access_token` do cookie.
205
+ This method decodes the JWT `access_token` and returns the value of the name attribute passed in the `attribute_name` parameter. This attribute can be a <b>mapper</b> - registered in the <b>Mappers</b> section of the Realm <b>Client</b> registry. If `access_token` is not informed then gem will use the `access_token` of the cookie.
186
206
 
187
207
 
188
208
  ```ruby
189
209
  Keycloak::Client.token
190
210
  ```
191
211
 
192
- Retorna o último token autenticado armazenado no cookie. Quando na aplicação é implementado o método `Keycloak.proc_cookie_token` e um usuário faz a autenticação da aplicação, esse método retornará o token desse usuário.
212
+ Returns the last authenticated token stored in the cookie. When the `Keycloak.proc_cookie_token` method is implemented in the application and a user authenticates the application, this method returns the token of that user.
193
213
 
194
214
 
195
215
  ```ruby
196
216
  Keycloak::Client.external_attributes
197
217
  ```
198
218
 
199
- Quando implementado o método `Keycloak.proc_external_attributes`, o método `external_attributes` o retornará. A finalidade desse método é retornar os atributos específicos da aplicação não mapeados no Keycloak.
219
+ When the `Keycloak.proc_external_attributes` method is implemented, the `external_attributes` method returns it. The purpose of this method is to return the application-specific attributes not mapped in Keycloak.
200
220
 
201
221
 
202
222
  ### Keycloak::Admin
203
223
 
204
- O módulo `Keycloak::Admin`disponibiliza métodos que representam as [REST APIs do Keycloak](http://www.keycloak.org/docs-api/3.2/rest-api/index.html). Para a utilização dessas APIs, será necessário um `access_token` ativo, ou seja, a autenticação deverá ocorrer antes da utilização dos métodos para que um token válido seja utilizado como credencial. Caso o `access_token` não seja informado, então a gem utilizará o `access_token` do cookie. O usuário autenticado deverá ter o `role` do respectivo serviço invocado - roles do client `realm-management`, que representa o gerenciamento do reino.
205
-
206
- Segue abaixo a lista dos métodos. O parâmetro de rota `{realm}` de todas as APIs será obtido do arquivo de instalação `keycloak.json`:
224
+ The `Keycloak :: Admin` module provides methods that represent the [REST APIs do Keycloak](http://www.keycloak.org/docs-api/3.2/rest-api/index.html). In order to use these APIs, an active `access_token` is required, that is, authentication must occur before using the methods for a valid token to be used as a credential. If `access_token` is not informed then gem will use the `access_token` of the cookie. The authenticated user must have the `role` of the respective service invoked - roles of the `realm-management` client, which represents the management of the realm.
207
225
 
226
+ The list of methods is shown below. The `{realm}` route parameter of all APIs will be obtained from the `keycloak.json` installation file:
208
227
 
209
228
  ```ruby
210
229
  # GET /admin/realms/{realm}/users
211
230
  Keycloak::Admin.get_users(query_parameters = nil, access_token = nil)
212
231
  ```
213
232
 
214
- `get_users` retorna uma lista de usuários, filtrada de acordo com o hash de parâmetros passado em `query_parameters`.
233
+ `get_users` returns a list of users, filtered according to the parameters <b>hash</b> passed in` query_parameters`.
215
234
 
216
235
 
217
236
  ```ruby
@@ -219,15 +238,14 @@ Keycloak::Admin.get_users(query_parameters = nil, access_token = nil)
219
238
  Keycloak::Admin.create_user(user_representation, access_token = nil)
220
239
  ```
221
240
 
222
- `create_user` cria um novo usuário no Keycloak. O parâmetro `user_representation` deve ser um hash conforme o [UserRepresentation](http://www.keycloak.org/docs-api/3.2/rest-api/index.html#_userrepresentation) do Keycloak. O retorno deste método será `true` para o caso de sucesso.
241
+ `create_user` creates a new user in Keycloak. The `user_representation` parameter must be a hash according to Keycloak [UserRepresentation](http://www.keycloak.org/docs-api/3.2/rest-api/index.html#_userrepresentation). The return of this method will be `true` for success.
223
242
 
224
243
 
225
244
  ```ruby
226
245
  # GET /admin/realms/{realm}/users/count
227
246
  Keycloak::Admin.count_users(access_token = nil)
228
247
  ```
229
-
230
- `count_users` retorna a quantidade de usuários do reino.
248
+ `count_users` returns the number of users in the realm.
231
249
 
232
250
 
233
251
  ```ruby
@@ -235,7 +253,7 @@ Keycloak::Admin.count_users(access_token = nil)
235
253
  Keycloak::Admin.get_user(id, access_token = nil)
236
254
  ```
237
255
 
238
- `get_user` retorna a representação do usuário identificado pelo parâmetro `id` - que é o <b>ID</b> criado pelo Keycloak ao criar um novo usuário.
256
+ `get_user` returns the user representation identified by the `id` parameter - which is the <b>ID</b> created by Keycloak when creating a new user.
239
257
 
240
258
 
241
259
  ```ruby
@@ -243,7 +261,7 @@ Keycloak::Admin.get_user(id, access_token = nil)
243
261
  Keycloak::Admin.update_user(id, user_representation, access_token = nil)
244
262
  ```
245
263
 
246
- `update_user` atualiza o cadastro do usuário identificado pelo `id` - que é o <b>ID</b> criado pelo Keycloak ao criar um novo usuário. No parâmetro `user_representation` deverá ser uma hash com os campos que serão alterados, respeitando o [UserRepresentation](http://www.keycloak.org/docs-api/3.2/rest-api/index.html#_userrepresentation) do Keycloak. O retorno deste método será `true` para o caso de sucesso.
264
+ `update_user` updates the user registry identified by `id` - which is the <b>ID</b> created by Keycloak when creating a new user. In the `user_representation` parameter should be a hash with the fields that will be changed, respecting the [UserRepresentation](http://www.keycloak.org/docs-api/3.2/rest-api/index.html#_userrepresentation) of Keycloak. The return of this method will be `true` for success.
247
265
 
248
266
 
249
267
  ```ruby
@@ -251,7 +269,7 @@ Keycloak::Admin.update_user(id, user_representation, access_token = nil)
251
269
  Keycloak::Admin.delete_user(id, access_token = nil)
252
270
  ```
253
271
 
254
- `delete_user` exclui o cadastro do usuário identificado pelo `id` - que é o <b>ID</b> criado pelo Keycloak ao criar um novo usuário. O retorno deste método será `true` para o caso de sucesso.
272
+ `delete_user` excludes the user ID identified by the `id` - which is the <b>ID</b> created by Keycloak when creating a new user. The return of this method will be `true` for success.
255
273
 
256
274
 
257
275
  ```ruby
@@ -259,7 +277,7 @@ Keycloak::Admin.delete_user(id, access_token = nil)
259
277
  Keycloak::Admin.revoke_consent_user(id, client_id = nil, access_token = nil)
260
278
  ```
261
279
 
262
- `revoke_consent_user` revoga os tokens de um usuário identificado pelo `id` - que é o <b>ID</b> criado pelo Keycloak ao criar um novo usuário - no client identificado pelo parâmetro `client_id`.
280
+ `revoke_consent_user` revokes the tokens of a user identified by `id` - which is the <b>ID</b> created by Keycloak when creating a new user - on the client identified by the `client_id` parameter.
263
281
 
264
282
 
265
283
  ```ruby
@@ -267,7 +285,7 @@ Keycloak::Admin.revoke_consent_user(id, client_id = nil, access_token = nil)
267
285
  Keycloak::Admin.update_account_email(id, actions, redirect_uri = '', client_id = nil, access_token = nil)
268
286
  ```
269
287
 
270
- `update_account_email` envia um e-mail de atualização da conta para o usuário representado pelo parâmetro `id`. O e-mail contém um link que o usuário poderá clicar para executar um conjunto de ações representados pelo parâmetro `actions` - que aguarda um `array` de [ações definidas pelo Keycloak](http://www.keycloak.org/docs/3.2/server_admin/topics/users/required-actions.html). Um exemplo de valor que pode ser passado para o parâmetro `actions` é `['UPDATE_PASSWORD']`, que indica que a ação que o usuário deverá tomar ao clicar o link do e-mail é de alterar a sua senha. No parâmetro `redirect_uri`, caso necessário, deverá ser passada uma <b>url</b> para que, ao término do envio do e-mail, a aplicação seja redirecionada. O parâmetro `client_id` deverá ser informado caso o Client responsável pela as ações que deverão ser executadas não seja o mesmo do arquivo de instalação `keycloak.json`.
288
+ `update_account_email` sends an account update email to the user represented by the `id` parameter. The email contains a link that the user can click to execute a set of actions represented by the `actions` parameter - which awaits an `array` of [actions defined by Keycloak](http://www.keycloak.org/docs/3.2/server_admin/topics/users/required-actions.html). An example value that can be passed to the `actions` parameter is `['UPDATE_PASSWORD']`, which indicates that the action that the user must take when clicking the link in the email is to change their password. In the `redirect_uri` parameter, if necessary, a url must be passed so that, at the end of sending the e-mail, the application is redirected. The `client_id` parameter should be informed if the Client responsible for the actions to be performed is not the same as the `keycloak.json` installation file.
271
289
 
272
290
 
273
291
  ```ruby
@@ -275,7 +293,7 @@ Keycloak::Admin.update_account_email(id, actions, redirect_uri = '', client_id =
275
293
  Keycloak::Admin.get_role_mappings(id, access_token = nil)
276
294
  ```
277
295
 
278
- `get_role_mappings` retorna todas as <b>Role Mappings</b> do reino atribuídas ao usuário identificado pelo parâmetro `id`, independentemente do Client.
296
+ `get_role_mappings` returns all <b>Role Mappings</b> in the realm assigned to the user identified by the `id` parameter, regardless of the Client.
279
297
 
280
298
 
281
299
  ```ruby
@@ -283,7 +301,7 @@ Keycloak::Admin.get_role_mappings(id, access_token = nil)
283
301
  Keycloak::Admin.get_clients(query_parameters = nil, access_token = nil)
284
302
  ```
285
303
 
286
- `get_clients` retorna uma lista de [ClientRepresentation](http://www.keycloak.org/docs-api/3.2/rest-api/index.html#_clientrepresentation) Clients pertencentes ao reino. O parâmetro `query_parameters` espera um hash com os atributos `clientId` - caso deseje que a lista seja filtrada pelo `client_id` - e `viewableOnly` - para filtrar se os Clients de administração do Keycloak serão ou não retornados na lista.
304
+ `get_clients` returns a list of [ClientRepresentation](http://www.keycloak.org/docs-api/3.2/rest-api/index.html#_clientrepresentation) pertaining to the realm. The `query_parameters` parameter expects a hash with `clientId` attributes - if you want the list to be filtered by `client_id` - and `viewableOnly` - to filter whether the Keycloak Administration Clients will be returned in the list.
287
305
 
288
306
 
289
307
  ```ruby
@@ -291,7 +309,7 @@ Keycloak::Admin.get_clients(query_parameters = nil, access_token = nil)
291
309
  Keycloak::Admin.get_all_roles_client(id, access_token = nil)
292
310
  ```
293
311
 
294
- `get_all_roles_client` retorna uma lista de [RoleRepresentation](http://www.keycloak.org/docs-api/3.2/rest-api/index.html#_rolerepresentation) com todos os <b>roles</b> do client identificado pelo parâmetro `id` - deve ser passado nesse parâmetro o `ID` do Client e não o `client_id`.
312
+ `get_all_roles_client` returns a [RoleRepresentation](http://www.keycloak.org/docs-api/3.2/rest-api/index.html#_rolerepresentation) list with all client <b>roles</b> identified by the `id` parameter - this parameter must be passed in the ID of the Clint and not `client_id`.
295
313
 
296
314
 
297
315
  ```ruby
@@ -299,7 +317,7 @@ Keycloak::Admin.get_all_roles_client(id, access_token = nil)
299
317
  Keycloak::Admin.get_roles_client_by_name(id, role_name, access_token = nil)
300
318
  ```
301
319
 
302
- `get_roles_client_by_name` retorna a [RoleRepresentation](http://www.keycloak.org/docs-api/3.2/rest-api/index.html#_rolerepresentation) do role identificado pelo parâmetro `role_name` - que é o nome do role.
320
+ `get_roles_client_by_name` returns the [RoleRepresentation](http://www.keycloak.org/docs-api/3.2/rest-api/index.html#_rolerepresentation) of the role identified by the parameter `role_name` - which is the name of the role.
303
321
 
304
322
 
305
323
  ```ruby
@@ -307,7 +325,7 @@ Keycloak::Admin.get_roles_client_by_name(id, role_name, access_token = nil)
307
325
  Keycloak::Admin.add_client_level_roles_to_user(id, client, role_representation, access_token = nil)
308
326
  ```
309
327
 
310
- `add_client_level_roles_to_user` insere um <b>role</b> do Client (representado pelo parâmetro `client`) ao usuário representado pelo parâmetro `id`. O parâmetro `role_representation` deverá receber um `array` de [RoleRepresentation](http://www.keycloak.org/docs-api/3.2/rest-api/index.html#_rolerepresentation) que serão inseridos no usuário. Em caso de sucesso, o retorno será `true`.
328
+ `add_client_level_roles_to_user` inserts a <b>role</b> from the Client (represented by the `client` parameter) to the user represented by the `id` parameter. The `role_representation` parameter should receive an `array` of [RoleRepresentation](http://www.keycloak.org/docs-api/3.2/rest-api/index.html#_rolerepresentation) that will be entered into the user. On success, the return will be `true`.
311
329
 
312
330
 
313
331
  ```ruby
@@ -315,7 +333,7 @@ Keycloak::Admin.add_client_level_roles_to_user(id, client, role_representation,
315
333
  Keycloak::Admin.delete_client_level_roles_from_user(id, client, role_representation, access_token = nil)
316
334
  ```
317
335
 
318
- `delete_client_level_roles_from_user` exclui um <b>Client-Role</b> (representado pelo parâmetro `client`) do usuário representado pelo parâmetro `id`. O parâmetro `role_representation` deverá receber um `array` de [RoleRepresentation](http://www.keycloak.org/docs-api/3.2/rest-api/index.html#_rolerepresentation) que serão retirados do usuário. Em caso de sucesso, o retorno será `true`.
336
+ `delete_client_level_roles_from_user` deletes a <b>Client-Role</b> (representado pelo parâmetro `client`) of the user represented by the `id` parameter. The `role_representation` parameter should receive an `array` of [RoleRepresentation](http://www.keycloak.org/docs-api/3.2/rest-api/index.html#_rolerepresentation) that will be removed on the user. On success, the return will be `true`.
319
337
 
320
338
 
321
339
  ```ruby
@@ -323,14 +341,14 @@ Keycloak::Admin.delete_client_level_roles_from_user(id, client, role_representat
323
341
  Keycloak::Admin.get_client_level_role_for_user_and_app(id, client, access_token = nil)
324
342
  ```
325
343
 
326
- `get_client_level_role_for_user_and_app` retorna uma lista de [RoleRepresentation](http://www.keycloak.org/docs-api/3.2/rest-api/index.html#_rolerepresentation) dos <b>Client-Roles</b> do Client representado pelo parâmetro `client` vinculados ao usuário representado pelo parâmetro `id`.
344
+ `get_client_level_role_for_user_and_app` return a list of [RoleRepresentation](http://www.keycloak.org/docs-api/3.2/rest-api/index.html#_rolerepresentation) of client <b>Client-Roles</b>, represented by `client` parameter linked to the user represented by the `id` parameter.
327
345
 
328
346
 
329
347
  ```ruby
330
348
  Keycloak::Admin.update_effective_user_roles(id, client_id, roles_names, access_token = nil)
331
349
  ```
332
350
 
333
- `update_effective_user_roles` não está na lista de <b>Admin APIs</b> do Keycloak. Este método vincula ao usuário representado pelo parâmetro `id` todos os roles passados em um `array` no parâmetro `roles_names`. Os roles passados no parâmetro `roles_names` deverão pertencer ao Client representado pelo parâmetro `client_id`. Caso o usuário possua o vínculo com um role que não esteja no parâmetro `roles_names`, esse vínculo será removido, pois a finalidade desse método é que o usuário assuma efetivamente os roles passados nesse parâmetro. Em caso de sucesso, o retorno será `true`.
351
+ `update_effective_user_roles` is not on the Keycloak <b>Admin APIs</b> list. This method binds to the user represented by the `id` parameter all the roles passed in an` array` in the `roles_names` parameter. The roles passed in the `roles_names` parameter must belong to the Client represented by the` client_id` parameter. If the user has the link with a role that is not in the `roles_names` parameter, this link will be removed because the purpose of this method is for the user to effectively assume the roles passed in this parameter. On success, the return will be `true`.
334
352
 
335
353
 
336
354
  ```ruby
@@ -338,7 +356,7 @@ PUT /admin/realms/{realm}/users/{id}/reset-password
338
356
  Keycloak::Admin.reset_password(id, credential_representation, access_token = nil)
339
357
  ```
340
358
 
341
- `reset_password` altera a senha do usuário representado pelo parâmetro `id`. A nova senha é representada pelo parâmetro `credential_representation`, que trata-se de um conjunto de informações formatadas segundo a seção [CredentialRepresentation](http://www.keycloak.org/docs-api/3.2/rest-api/index.html#_credentialrepresentation) do manual de APIs do Keycloak.
359
+ `reset_password` change the user password represented by `id` parameter. The new password is represented by `credential_representation` parameter, which is a set of information formatted under the [CredentialRepresentation](http://www.keycloak.org/docs-api/3.2/rest-api/index.html#_credentialrepresentation) section of the Keycloak API manual.
342
360
 
343
361
 
344
362
  ```ruby
@@ -346,12 +364,12 @@ GET /admin/realms/{realm}/groups/{id}/role-mappings/clients/{client}/composite
346
364
  Keycloak::Admin.get_effective_client_level_role_composite_user(id, client, access_token = nil)
347
365
  ```
348
366
 
349
- `get_effective_client_level_role_composite_user` retorna uma lista (array) de [RoleRepresentation](http://www.keycloak.org/docs-api/3.2/rest-api/index.html#_rolerepresentation) de um <b>Grupo</b> representado pelo parâmetro `id` atrelados a um <b>Client</b> representado pelo parâmetro `client`.
367
+ `get_effective_client_level_role_composite_user` return a list (array) of [RoleRepresentation](http://www.keycloak.org/docs-api/3.2/rest-api/index.html#_rolerepresentation) of a <b>Group</b> represented by `id` parameter attached to a <b>Client</b> represented by `client` parameter.
350
368
 
351
369
 
352
- Caso tenha algum serviço no manual [Keycloak Admin REST API](http://www.keycloak.org/docs-api/3.2/rest-api/index.html) que não tenha sido implementado na gem, uma possibilidade do mesmo ser invocado utilizando os <b>Generics Methods</b> do modelu `Keycloak::Admin`. Os <b>Generics Methods</b> te possibilita fazer a requisição de qualquer uma das APIs, seja ela `GET`, `POST`, `PUT` ou `DELETE`, passando os parâmetros da requisição como `hashes` nos parâmetros `query_parameters` e `body_parameter` dos <b>Generics Methods</b>.
370
+ If there is any service in the manual [Keycloak Admin REST API](http://www.keycloak.org/docs-api/3.2/rest-api/index.html) that has not been implemented in this gem, there is a possibility of being invoked using the <b>Generics Methods</b> of the `Keycloak::Admin` model. The <b>Generics Methods</b> allow you to request any of the APIs, either `GET`,` POST`, `PUT` or` DELETE`, passing the request parameters as `hashes` in the parameters` query_parameters` and `body_parameter` of the <b>Generics Methods</b>.
353
371
  <br>
354
- Veja a seguir os <b>Generics Methods</b>:
372
+ The following are the <b>Generics Methods</b>:
355
373
  <br>
356
374
 
357
375
  ```ruby
@@ -365,7 +383,6 @@ Exemplo:
365
383
  ```
366
384
 
367
385
 
368
-
369
386
  ```ruby
370
387
  Keycloak::Admin.generic_post(service, query_parameters, body_parameter, access_token = nil)
371
388
  ```
data/README.pt-BR.md CHANGED
@@ -21,10 +21,6 @@ Ou instale você mesmo:
21
21
 
22
22
  $ gem install keycloak
23
23
 
24
- To add the configuration file:
25
-
26
- $ rails generate initializer
27
-
28
24
  Para adicionar o arquivo de configuração:
29
25
 
30
26
  $ rails generate initializer
@@ -45,14 +41,14 @@ O módulo Keycloak possui alguns atributos e suas definições são fundamentais
45
41
  Keycloak.realm
46
42
  ```
47
43
 
48
- Se a sua aplicação não trabalha apenas com um client específico (aplicação servidora de APIs, por exemplo), então você poderá informar o nome reino que a gem irá interagir nesse atributo. Ao ser instalada, a gem cria o arquivo `keycloak.rb` em `config/initializers`. Este atributo pode ser encontrado e definido nesse arquivo.
44
+ Se a sua aplicação não trabalha apenas com um client específico (aplicação servidora de APIs, por exemplo), então você poderá informar o nome do reino que a gem irá interagir nesse atributo. Ao ser instalada, a gem cria o arquivo `keycloak.rb` em `config/initializers`. Este atributo pode ser encontrado e definido nesse arquivo.
49
45
 
50
46
 
51
47
  ```ruby
52
48
  Keycloak.auth_server_url
53
49
  ```
54
50
 
55
- Para o mesmo cenário do atributo acima, você poderá informar a url reino que a gem irá interagir nesse atributo. Ao ser instalada, a gem cria o arquivo `keycloak.rb` em `config/initializers`. Este atributo pode ser encontrado e definido nesse arquivo.
51
+ Para o mesmo cenário do atributo acima, você poderá informar a url do reino que a gem irá interagir nesse atributo. Ao ser instalada, a gem cria o arquivo `keycloak.rb` em `config/initializers`. Este atributo pode ser encontrado e definido nesse arquivo.
56
52
 
57
53
 
58
54
  ```ruby
@@ -140,6 +136,20 @@ Keycloak::Client.get_token_by_code(code, redirect_uri)
140
136
  Ao utilizar o método `Keycloak::Client.url_login_redirect` para obter um `code`, passe-o como parâmetro neste método para que o Keycloak retorne um token, efetuando assim o login do usuário na aplicação. O segundo parâmetro (`redirect_uri`) deve ser passado para que, ao disponibilizar um token, o Keycloak redirecione para a url informada.
141
137
 
142
138
 
139
+ ```ruby
140
+ Keycloak::Client.get_token_by_exchange(issuer, issuer_token)
141
+ ```
142
+
143
+ Para obter um token através de um token obtido anteriormente de um provedor confiável (padrão OpenID), como Facebook, Gooble, Twitter, ou até mesmo outro reino configurado no keycloak, basta invocar este método, passando no parâmetro `issuer` o alias do provedor configurado no reino, e, no parâmetro `issuer_token` o token obtido por esse provedor. Com isso, será retornado um token autenticado pelo teu reino.
144
+
145
+
146
+ ```ruby
147
+ Keycloak::Client.get_userinfo_issuer(access_token = '')
148
+ ```
149
+
150
+ Esse método retorna as informações do usuário de um provevedor (`issuer` do método `get_token_by_exchange`) representado pelo `access_token` passado como parâmetro. Caso o parâmetro `access_token` não seja informado, então a gem obterá essa informação no cookie.
151
+
152
+
143
153
  ```ruby
144
154
  Keycloak::Client.get_token_by_refresh_token(refresh_token = '')
145
155
  ```
@@ -367,7 +377,7 @@ Keycloak::Admin.get_effective_client_level_role_composite_user(id, client, acces
367
377
  `get_effective_client_level_role_composite_user` retorna uma lista (array) de [RoleRepresentation](http://www.keycloak.org/docs-api/3.2/rest-api/index.html#_rolerepresentation) de um <b>Grupo</b> representado pelo parâmetro `id` atrelados a um <b>Client</b> representado pelo parâmetro `client`.
368
378
 
369
379
 
370
- Caso tenha algum serviço no manual [Keycloak Admin REST API](http://www.keycloak.org/docs-api/3.2/rest-api/index.html) que não tenha sido implementado na gem, há uma possibilidade do mesmo ser invocado utilizando os <b>Generics Methods</b> do modelu `Keycloak::Admin`. Os <b>Generics Methods</b> te possibilita fazer a requisição de qualquer uma das APIs, seja ela `GET`, `POST`, `PUT` ou `DELETE`, passando os parâmetros da requisição como `hashes` nos parâmetros `query_parameters` e `body_parameter` dos <b>Generics Methods</b>.
380
+ Caso tenha algum serviço no manual [Keycloak Admin REST API](http://www.keycloak.org/docs-api/3.2/rest-api/index.html) que não tenha sido implementado na gem, há uma possibilidade do mesmo ser invocado utilizando os <b>Generics Methods</b> do model `Keycloak::Admin`. Os <b>Generics Methods</b> te possibilita fazer a requisição de qualquer uma das APIs, seja ela `GET`, `POST`, `PUT` ou `DELETE`, passando os parâmetros da requisição como `hashes` nos parâmetros `query_parameters` e `body_parameter` dos <b>Generics Methods</b>.
371
381
  <br>
372
382
  Veja a seguir os <b>Generics Methods</b>:
373
383
  <br>
@@ -1,3 +1,3 @@
1
1
  module Keycloak
2
- VERSION = "2.3.0"
2
+ VERSION = "2.3.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: keycloak
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0
4
+ version: 2.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Guilherme Portugues
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-02-01 00:00:00.000000000 Z
11
+ date: 2018-03-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -107,6 +107,7 @@ files:
107
107
  - ".vscode/launch.json"
108
108
  - CODE_OF_CONDUCT.md
109
109
  - Gemfile
110
+ - Gemfile.lock
110
111
  - LICENSE.txt
111
112
  - README.md
112
113
  - README.pt-BR.md