public static UserIdentityToken createAnonymousIdentityToken(EndpointDescription ep) throws ServiceResultException {
  UserTokenPolicy policy=ep.findUserTokenPolicy(UserTokenType.Anonymous);
  if (policy == null)   throw new ServiceResultException(StatusCodes.Bad_IdentityTokenRejected,"Anonymous UserTokenType is not supported");
  return new AnonymousIdentityToken(policy.getPolicyId());
}

public static UserIdentityToken createAnonymousIdentityToken ( EndpointDescription ep ) throws ServiceResultException { UserTokenPolicy policy = ep . findUserTokenPolicy ( UserTokenType . Anonymous ) ; if ( policy == null ) throw new ServiceResultException ( StatusCodes . Bad_IdentityTokenRejected , "Anonymous UserTokenType is not supported" ) ; return new AnonymousIdentityToken ( policy . getPolicyId ( ) ) ; }
create anonymous user identity token
