public static IPrincipal Validate(this IPrincipal user) { if (!user.IsAuthenticated() || !user.IsAuthorized()) { throw new UnauthorizedAPIException($"User '{user.UserName()}' is not Authorized in '{user.ApplicationName()}'!"); } return(user); }