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

Attribute attrAppContext = null;
Attribute attrIdentity = null;
Attribute attrLogin = null;

ApplicationContext appContext = null;
Identity identityObj = null;
LoginSession session = null;

String FEATURE_NAME = "Addition";
String CONTACT_SERVER = "localhost";
String CustomUserName = "customUser";

API Calls

attrAppContext = new Attribute();
attrAppContext.set(LicensingConstants.SNTL_ATTR_APPCONTEXT_CONTACT_SERVER, CONTACT_SERVER);
appContext = new ApplicationContext(attrAppContext);
 
attrIdentity = new Attribute();
attrIdentity.set(LicensingConstants.SNTL_ATTR_IDENTITY_USERNAME, CustomUserName);
identityObj = new Identity(appContext, attrIdentity);
String identity_string = identityObj.serialize();
 
attrLogin = new Attribute();
attrLogin.set(LicensingConstants.SNTL_ATTR_LOGIN_IDENTITY_STRING, identity_string);
session = new LoginSession();
session.login(appContext, FEATURE_NAME, attrLogin);