-
Notifications
You must be signed in to change notification settings - Fork 71
/
QQConnectOAuthOptions.cs
44 lines (34 loc) · 1.23 KB
/
QQConnectOAuthOptions.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
using Microsoft.Owin.Security;
using System;
using System.Collections.Generic;
namespace OAuth2.QQConnect.Owin
{
public class QQConnectOAuthOptions : AuthenticationOptions
{
public QQConnectOAuthOptions()
: base("qq.connect")
{
DisplayName = "QQ Connect";
AuthenticationMode = AuthenticationMode.Passive;
}
public string ClientId { get; set; }
public string ClientSecret { get; set; }
public bool IsMobile { get; set; } = false;
public ISet<string> Scopes { get; set; } = new HashSet<string> { "get_user_info" };
public string CallbackPath { get; set; } = "/oauth2/qq-connect/callback";
public string DisplayName
{
get => Description.Caption;
set => Description.Caption = value;
}
public string SignInAsAuthenticationType { get; set; }
public ISecureDataFormat<AuthenticationProperties> StateDataFormat { get; set; }
internal QQConnectOptions BuildQQConnectOptions(Func<string> redirectUrl)
{
return new QQConnectOptions(ClientId, ClientSecret, IsMobile, Scopes)
{
RedirectUrl = redirectUrl
};
}
}
}