Register Client and Secret (admin task) More...
When building apps on SAS Viya, an client id and secret is required. This macro will obtain the Consul Token and use that to call the Web Service.
The default viyaroot location is /opt/sas/viya/config
%* compile macros; filename mc url "https://raw.githubusercontent.com/sasjs/core/main/all.sas"; %inc mc; %* specific client with just openid scope; %mv_registerclient(client_id=YourClient ,client_secret=YourSecret ,scopes=openid ) %* generate random client details with all scopes; %mv_registerclient(scopes=openid *) %* generate random client with 90/180 second access/refresh token expiry; %mv_registerclient(scopes=openid * ,access_token_validity=90 ,refresh_token_validity=180 )
|client_id=||The client name. Auto generated if blank.|
|client_secret=||Client secret Auto generated if client is blank.|
|scopes=||list of space-seperated unquoted scopes (default is openid)|
|grant_type=||valid values are "password" or "authorization_code" (unquoted)|
|outds=||the dataset to contain the registered client id and secret|
|access_token_validity=||The duration of validity of the access token in seconds. A value of DEFAULT will omit the entry (and use system default)|
|refresh_token_validity=||The duration of validity of the refresh token in seconds. A value of DEFAULT will omit the entry (and use system default)|
|name=||A human readable name for the client|
|required_user_groups=||A list of group names. If a user does not belong to all the required groups, the user will not be authenticated and no tokens are issued to this client for that user. If this field is not specified, authentication and token issuance proceeds normally.|
|autoapprove=||During the auth step the user can choose which scope to apply. Setting this to true will autoapprove all the client scopes.|
|use_session=||If true, access tokens issued to this client will be associated with an HTTP session and revoked upon logout or time-out.|
|outjson=||A dataset containing the lines of JSON submitted. Useful for debugging. Default= null.|
Definition in file mv_registerclient.sas.