/** * Sets the appropriate fields on the EzSecurityToken for the passed in application information * * @param token an EzSecurityToken to populate with AppInfo. This object will only have AppInfo * updated on it * @param appId the application security id, defaultSecurityId will be used if null * @param appPrincipal the application's principal, defaultSecurityId will be used if null */ public static void populateAppInfo( final EzSecurityToken token, String appId, String appPrincipal) { token.getValidity().setIssuedTo((appId == null) ? defaultSecurityId : appId); token.getTokenPrincipal().setPrincipal((appId == null) ? defaultSecurityId : appId); token .getTokenPrincipal() .setExternalID((appPrincipal == null) ? defaultSecurityId : appPrincipal); }
/** * Set the appropriate fields on the EzSecurityToken for the passed in fields * * @param token an EzSecurityToken to populate with UserInfo. This object will only have UserInfo * updated on it * @param principal user principal, defaultUserPrincipal will be used if null * @param citizenship user citizenship, defaultUserCitizenship will be used if null * @param organization user organization, defaultUserOrganization will be used if null */ public static void populateUserInfo( final EzSecurityToken token, String principal, String citizenship, String organization) { token.getTokenPrincipal().setPrincipal((principal == null) ? defaultUserPrincipal : principal); token.setCitizenship((citizenship == null) ? defaultUserCitizenship : citizenship); token.setOrganization((organization == null) ? defaultUserOrganization : organization); }