-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIOpenIdService.cs
More file actions
72 lines (65 loc) · 3.2 KB
/
IOpenIdService.cs
File metadata and controls
72 lines (65 loc) · 3.2 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
64
65
66
67
68
69
70
71
72
using System.Threading.Tasks;
using IdentityModel.Client;
namespace OpenId.AspNet.Authentication
{
/// <summary>
/// Collection of service to work with OpenId Connect and OAuth2 protocols
/// </summary>
public interface IOpenIdService
{
/// <summary>
/// Gets the discovery information for specified Identity Server (Authority).
/// </summary>
/// <param name="authorityUrl">Optional. The authority URL.
/// If not specified, then default Authority will be used <see cref="OpenIdConnectOptions"/>
/// </param>
/// <returns>
/// Discover Response
/// </returns>
/// <exception cref="System.InvalidOperationException"></exception>
DiscoveryResponse GetDiscoveryInfo(string authorityUrl = null);
/// <summary>
/// Gets the discovery information for specified Identity Server (Authority).
/// </summary>
/// <param name="authorityUrl">Optional. The authority URL.
/// If not specified, then default Authority will be used <see cref="OpenIdConnectOptions"/>
/// </param>
/// <returns>
/// Discover Response
/// </returns>
/// <exception cref="System.InvalidOperationException"></exception>
Task<DiscoveryResponse> GetDiscoveryInfoAsyc(string authorityUrl = null);
/// <summary>
/// Gets the access token on behalf of currently logged user.
/// </summary>
/// <returns></returns>
string GetUserAccessToken();
/// <summary>
/// Gets the access token on behalf of currently logged user.
/// </summary>
/// <returns></returns>
Task<string> GetUserAccessTokenAsync();
/// <summary>
/// Gets the Client/Application security token. That can be used to access OAuth2 resources
/// </summary>
/// <param name="resourceId">The resource identifier for which credentials are being requested</param>
/// <param name="clientId">The Client identifier. Default: <see cref="OpenIdConnectOptions.ClientId" /></param>
/// <param name="clientSecret">The client secret. Default: <see cref="OpenIdConnectOptions.ClientSecret" /></param>
/// <param name="authorityUrl">The authority URL. <see cref="OpenIdConnectOptions.Authority" /></param>
/// <returns>
/// Encoded JWT token
/// </returns>
string GetClientCredentials(string resourceId, string clientId = null, string clientSecret = null, string authorityUrl = null);
/// <summary>
/// Gets the client credentials asynchronous.
/// </summary>
/// <param name="resourceId">The resource identifier.</param>
/// <param name="clientId">The client identifier.</param>
/// <param name="clientSecret">The client secret.</param>
/// <param name="authorityUrl">The authority URL.</param>
/// <returns></returns>
/// <exception cref="System.ArgumentNullException">resourceId</exception>
/// <exception cref="System.InvalidOperationException"></exception>
Task<string> GetClientCredentialsAsync(string resourceId, string clientId = null, string clientSecret = null, string authorityUrl = null);
}
}