Method: CF::UAA::Scim#change_secret

Defined in:
lib/uaa/scim.rb

#change_secret(client_id, new_secret, old_secret = nil) ⇒ Hash

Change client secret.

  • For a client to change its own secret, the token in @auth_header must contain “client.secret” scope and the correct old_secret must be given.

  • For an admin to set a client secret, the token in @auth_header must contain “uaa.admin” scope.



281
282
283
284
285
286
287
# File 'lib/uaa/scim.rb', line 281

def change_secret(client_id, new_secret, old_secret = nil)
  req = {"secret" => new_secret }
  req["oldSecret"] = old_secret if old_secret
  json_parse_reply(@key_style, *json_put(@target,
      "#{type_info(:client, :path)}/#{URI.encode(client_id)}/secret", req,
      'authorization' => @auth_header))
end