Production Ready Macros for SAS Application Developers File Reference

Register Client and Secret (admin task) More...

Go to the source code of this file.

Detailed Description

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.

more info: and:

The default viyaroot location is /opt/sas/viya/config


%* compile macros;
filename mc url "";
%inc mc;

%* specific client with just openid scope;

%* 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 *
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.
VIYA V.03.04
Allan Bowe @source


Definition in file