1 //------------------------------------------------------------------------------
3 // Copyright (c) Microsoft Corporation.
4 // All rights reserved.
6 // This code is licensed under the MIT License.
8 // Permission is hereby granted, free of charge, to any person obtaining a copy
9 // of this software and associated documentation files(the "Software"), to deal
10 // in the Software without restriction, including without limitation the rights
11 // to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
12 // copies of the Software, and to permit persons to whom the Software is
13 // furnished to do so, subject to the following conditions :
15 // The above copyright notice and this permission notice shall be included in
16 // all copies or substantial portions of the Software.
18 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
21 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
26 //------------------------------------------------------------------------------
28 namespace Microsoft.IdentityModel.Clients.ActiveDirectory
30 internal class OAuthParameter
32 public const string ResponseType = "response_type";
33 public const string GrantType = "grant_type";
34 public const string ClientId = "client_id";
35 public const string ClientSecret = "client_secret";
36 public const string ClientAssertion = "client_assertion";
37 public const string ClientAssertionType = "client_assertion_type";
38 public const string RefreshToken = "refresh_token";
39 public const string RedirectUri = "redirect_uri";
40 public const string Resource = "resource";
41 public const string Code = "code";
42 public const string Scope = "scope";
43 public const string Assertion = "assertion";
44 public const string RequestedTokenUse = "requested_token_use";
45 public const string Username = "username";
46 public const string Password = "password";
48 public const string HasChrome = "haschrome";
49 public const string LoginHint = "login_hint"; // login_hint is not standard oauth2 parameter
50 public const string CorrelationId = OAuthHeader.CorrelationId; // correlation id is not standard oauth2 parameter
51 public const string Prompt = "prompt"; // prompt is not standard oauth2 parameter
54 internal class OAuthGrantType
56 public const string AuthorizationCode = "authorization_code";
57 public const string RefreshToken = "refresh_token";
58 public const string ClientCredentials = "client_credentials";
59 public const string Saml11Bearer = "urn:ietf:params:oauth:grant-type:saml1_1-bearer";
60 public const string Saml20Bearer = "urn:ietf:params:oauth:grant-type:saml2-bearer";
61 public const string JwtBearer = "urn:ietf:params:oauth:grant-type:jwt-bearer";
62 public const string Password = "password";
63 public const string DeviceCode = "device_code";
66 internal class OAuthResponseType
68 public const string Code = "code";
71 internal class OAuthAssertionType
73 public const string JwtBearer = "urn:ietf:params:oauth:client-assertion-type:jwt-bearer";
76 internal class OAuthRequestedTokenUse
78 public const string OnBehalfOf = "on_behalf_of";
81 internal class OAuthHeader
83 public const string CorrelationId = "client-request-id";
84 public const string RequestCorrelationIdInResponse = "return-client-request-id";
87 internal class OAuthError
89 public const string LoginRequired = "login_required";
92 internal class OAuthValue
94 public const string ScopeOpenId = "openid";
97 internal class PromptValue
99 public const string Login = "login";
100 public const string RefreshSession = "refresh_session";
102 // The behavior of this value is identical to prompt=none for managed users; However, for federated users, AAD
103 // redirects to ADFS as it cannot determine in advance whether ADFS can login user silently (e.g. via WIA) or not.
104 public const string AttemptNone = "attempt_none";