-
Notifications
You must be signed in to change notification settings - Fork 0
/
AdUserService.cs
58 lines (51 loc) · 1.98 KB
/
AdUserService.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using IdentityServer3.Core.Models;
using IdentityServer3.Core.Services.Default;
namespace IdentityServer.AzureAdUserService
{
public class AdUserService : UserServiceBase
{
public AdUserService(string clientId, string clientSecret, string tenant)
{
//setup B2CGraphClient
}
public override Task AuthenticateLocalAsync(LocalAuthenticationContext context)
{
//TODO RO FLOW to Azure AD Tenant, see unit tests for prototype.
return base.AuthenticateLocalAsync(context);
}
public override Task PostAuthenticateAsync(PostAuthenticationContext context)
{
return base.PostAuthenticateAsync(context);
}
public override Task IsActiveAsync(IsActiveContext context)
{
var subject = context.Subject; //Should be the objectid of the user.
//TODO Check with graph client that the account is enabled. See properties of GetAllUsers in unit tests
return base.IsActiveAsync(context);
}
public override Task GetProfileDataAsync(ProfileDataRequestContext context)
{
var subject = context.Subject;
//TODO Use graph client with subject as objectid to query for profile info.
return base.GetProfileDataAsync(context);
}
public override Task SignOutAsync(SignOutContext context)
{
//TODO Investigate if there is a endpoint on azure ad
return base.SignOutAsync(context);
}
public override Task PreAuthenticateAsync(PreAuthenticationContext context)
{
return base.PreAuthenticateAsync(context);
}
public override Task AuthenticateExternalAsync(ExternalAuthenticationContext context)
{
return base.AuthenticateExternalAsync(context);
}
}
}