public static bool IsAuthenticationStandardEnabled(this PermissionPolicyUser user, IObjectSpace os) { if (os == null) { return(false); } var userLoginInfo = os.FindObject <UserLoginInfo>(CriteriaOperator.And( new BinaryOperator(nameof(UserLoginInfo.LoginProviderName), SignInMiddlewareDefaults.DefaultClaimsIssuer), new BinaryOperator("User.Oid", user.Oid) )); if (userLoginInfo != null) { return(true); } else { if (os.GetObjectsCount(typeof(UserLoginInfo), new BinaryOperator("User.Oid", user.Oid)) == 0) { user.CreateUserLoginInfo(os, SignInMiddlewareDefaults.DefaultClaimsIssuer, null); return(true); } } return(false); }