nrpieper
/
XAF_how-to-use-google-facebook-and-microsoft-accounts-in-aspnet-xaf-applications-oauth2-demo-t535280
Public
forked from DevExpress-Examples/xaf-web-forms-use-oauth2-authentication-providers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOAuthUser.cs
37 lines (36 loc) · 1.47 KB
/
OAuthUser.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using DevExpress.Persistent.BaseImpl.PermissionPolicy;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DevExpress.Xpo;
using DevExpress.Persistent.BaseImpl;
using DevExpress.Persistent.Validation;
namespace AuthenticationOwin.Module.BusinessObjects {
public class OAuthUser : PermissionPolicyUser, IAuthenticationOAuthUser {
public bool EnableStandardAuthentication {
get { return GetPropertyValue<bool>("EnableStandardAuthentication"); }
set { SetPropertyValue("EnableStandardAuthentication", value); }
}
[Association, Aggregated]
public XPCollection<EmailEntity> OAuthAuthenticationEmails {
get { return GetCollection<EmailEntity>("OAuthAuthenticationEmails"); }
}
public OAuthUser(Session session) : base(session) { }
}
public class EmailEntity : BaseObject {
public EmailEntity(Session session) : base(session) {
}
[RuleUniqueValue("Unique_Email", DefaultContexts.Save, CriteriaEvaluationBehavior = CriteriaEvaluationBehavior.BeforeTransaction)]
public string Email {
get { return GetPropertyValue<string>("Email"); }
set { SetPropertyValue("Email", value); }
}
[Association]
public OAuthUser OAuthUser {
get { return GetPropertyValue<OAuthUser>("OAuthUser"); }
set { SetPropertyValue("OAuthUser", value); }
}
}
}