Repository navigation
Expand file tree
/
Copy pathTwitterOptions.cs
More file actions
63 lines (56 loc) · 2.41 KB
/
Copy pathTwitterOptions.cs
File metadata and controls
63 lines (56 loc) · 2.41 KB
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
59
60
61
62
63
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.ComponentModel;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authentication.Twitter;
using Microsoft.AspNetCore.Http;
namespace Microsoft.AspNetCore.Builder
{
/// <summary>
/// Options for the Twitter authentication middleware.
/// </summary>
public class TwitterOptions : RemoteAuthenticationOptions
{
/// <summary>
/// Initializes a new instance of the <see cref="TwitterOptions"/> class.
/// </summary>
public TwitterOptions()
{
AuthenticationScheme = TwitterDefaults.AuthenticationScheme;
DisplayName = AuthenticationScheme;
CallbackPath = new PathString("/signin-twitter");
BackchannelTimeout = TimeSpan.FromSeconds(60);
Events = new TwitterEvents();
}
/// <summary>
/// Gets or sets the consumer key used to communicate with Twitter.
/// </summary>
/// <value>The consumer key used to communicate with Twitter.</value>
public string ConsumerKey { get; set; }
/// <summary>
/// Gets or sets the consumer secret used to sign requests to Twitter.
/// </summary>
/// <value>The consumer secret used to sign requests to Twitter.</value>
public string ConsumerSecret { get; set; }
/// <summary>
/// Enables the retrieval user details during the authentication process, including
/// e-mail addresses. Retrieving e-mail addresses requires special permissions
/// from Twitter Support on a per application basis. The default is false.
/// See https://dev.twitter.com/rest/reference/get/account/verify_credentials
/// </summary>
public bool RetrieveUserDetails { get; set; }
/// <summary>
/// Gets or sets the type used to secure data handled by the middleware.
/// </summary>
public ISecureDataFormat<RequestToken> StateDataFormat { get; set; }
/// <summary>
/// Gets or sets the <see cref="ITwitterEvents"/> used to handle authentication events.
/// </summary>
public new ITwitterEvents Events
{
get { return (ITwitterEvents)base.Events; }
set { base.Events = value; }
}
}
}