Setting up User Name Alias

Description

This can be used to set the user name that needs to be aliased to a different string for usage logs and reports.

Declare Variables/Constants

#define FEATURE_NAME           "Addition"
#define CONTACT_SERVER         "localhost"
#define CustomUserName         "customUser"

char *identity_string = NULL;
sntl_licensing_identity_t *identity_obj = NULL;
	
sntl_licensing_attr_t *pAttrAppContext = NULL;
sntl_licensing_attr_t *pAttridentity = NULL;
sntl_licensing_attr_t *pAttrLogin = NULL;

sntl_licensing_app_context_t *pAppContext = NULL;
sntl_licensing_login_session_t *pLoginSession = NULL; 

API Calls

sntl_licensing_attr_new(&pAttrAppContext);
sntl_licensing_attr_set(pAttrAppContext, SNTL_ATTR_APPCONTEXT_CONTACT_SERVER, CONTACT_SERVER);
sntl_licensing_app_context_new(0, pAttrAppContext, &pAppContext);

sntl_licensing_attr_new(&pAttridentity);
sntl_licensing_attr_set(pAttridentity, SNTL_ATTR_IDENTITY_USERNAME, CustomUserName);
sntl_licensing_identity_new(pAppContext, pAttridentity, &identity_obj);
sntl_licensing_identity_serialize(identity_obj, &identity_string);

sntl_licensing_attr_new(&pAttrLogin);
sntl_licensing_attr_set(pAttrLogin, SNTL_ATTR_LOGIN_IDENTITY_STRING, identity_string);
sntl_licensing_login_attr(pAppContext, FEATURE_NAME, pAttrLogin, &pLoginSession);