Method: Keycloak::Client.get_token
- Defined in:
- lib/keycloak.rb
.get_token(user, password, client_id = '', secret = '') ⇒ Object
42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/keycloak.rb', line 42 def self.get_token(user, password, client_id = '', secret = '') setup_module client_id = @client_id if client_id.blank? secret = @secret if secret.blank? payload = { 'client_id' => client_id, 'client_secret' => secret, 'username' => user, 'password' => password, 'grant_type' => 'password' } mount_request_token(payload) end |