Release 4.0.0-preview1-00051
[platform/core/csapi/tizenfx.git] / src / Tizen.Account.OAuth2 / Tizen.Account.OAuth2 / TokenRequest.cs
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * Licensed under the Apache License, Version 2.0 (the License);
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an AS IS BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 using System;
18 using System.Collections.Generic;
19
20 namespace Tizen.Account.OAuth2
21 {
22     /// <summary>
23     /// Abstract wrapper class containing OAuth 2.0 request parameters for requesting an access token.
24     /// </summary>
25     /// <since_tizen> 3 </since_tizen>
26     public abstract class TokenRequest
27     {
28         /// <summary>
29         /// The Grant type
30         /// </summary>
31         /// <since_tizen> 3 </since_tizen>
32         public abstract string GrantType { get; }
33
34         /// <summary>
35         /// The client credentials
36         /// </summary>
37         /// <since_tizen> 3 </since_tizen>
38         public ClientCredentials ClientSecrets { get; set; }
39
40         /// <summary>
41         /// The access token end point URL.
42         /// </summary>
43         /// <since_tizen> 3 </since_tizen>
44         public Uri TokenEndpoint { get; set; }
45
46         /// <summary>
47         /// The redirection endpoint of the auhorization flow.
48         /// </summary>
49         /// <since_tizen> 3 </since_tizen>
50         public Uri RedirectionEndPoint { get; set; }
51
52         /// <summary>
53         /// The scope of the access request as described by https://tools.ietf.org/html/rfc6749#section-3.3
54         /// </summary>
55         /// <since_tizen> 3 </since_tizen>
56         public IEnumerable<string> Scopes { get; set; }
57
58         /// <summary>
59         /// Custom key-value parameters to be sent to the server
60         /// </summary>
61         /// <since_tizen> 3 </since_tizen>
62         public IEnumerable<KeyValuePair<string, string>> CustomData { get; set; }
63
64         /// <summary>
65         /// Client authentication scheme. Default is Basic
66         /// </summary>
67         /// <since_tizen> 3 </since_tizen>
68         public AuthenticationScheme AuthenticationScheme { get; set; } = AuthenticationScheme.Basic;
69
70         /// <summary>
71         /// The client's state which is maintained between request and response.
72         /// </summary>
73         /// <since_tizen> 3 </since_tizen>
74         public string State { get; set; }
75     }
76 }