Create a new client for API call

register_client(
  session,
  client_id,
  client_secret,
  scope = list("openid"),
  access_token_validity = 36000,
  authorized_grant_types = list("client_credentials"),
  authorities = list("uaa.none"),
  additional_parameters = NULL,
  ...
)

Arguments

session

viya_connection object, obtained through session function

client_id

name of the new client to be created

client_secret

client secret of the new client

scope

The scopes allowed for the client to obtain on behalf of users, when using any grant type other than "client_credentials". Groups are treated as scopes. Therefore, the scopes that can be obtained by the client on behalf of a user will be the intersection of the user's groups and the scopes registered to the client via this property. Use the wildcard "" to match all groups. Since SAS Viya allows authorization rules to explicitly deny access to specific groups, SAS recommends always using "". The wildcard "*" will not match internal UAA scopes. This list should always include the scope "openid", which is used to assert the identity of the user that the client is acting on behalf of. For clients that only use the grant type "client_credentials" and therefore do not act on behalf of users, use the default scope "uaa.none".

access_token_validity

The time in seconds to access token expiration after it is issued.

authorized_grant_types

The list of grant types that can be used to obtain a token with this client. Types can include authorization_code, password, implicit, and client_credentials.

authorities

The scopes that the client is able to grant itself when using the "client_credentials" grant type. Wildcards are not allowed.

additional_parameters

list of parameters and lists to be added to the client creation payload

...

additional parameters to be passed to httr::POST such as httr::add_headers

Value

A sasClient object list

Examples


if (FALSE) { # \dontrun{
new_client <- register_client(sess, 'my_client', 'my_s3cr3t!')
new_client
} # }