OLD | NEW |
(Empty) | |
| 1 /* |
| 2 Copyright 2013 Google Inc |
| 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 |
| 19 using Google.Apis.Auth.OAuth2.Requests; |
| 20 |
| 21 namespace Google.Apis.Auth.OAuth2 |
| 22 { |
| 23 /// <summary> |
| 24 /// Google specific authorization code flow which inherits from <seealso cre
f="AuthorizationCodeFlow"/>. |
| 25 /// </summary> |
| 26 public class GoogleAuthorizationCodeFlow : AuthorizationCodeFlow |
| 27 { |
| 28 /// <summary>Constructs a new Google authorization code flow.</summary> |
| 29 public GoogleAuthorizationCodeFlow(AuthorizationCodeFlow.Initializer ini
tializer) |
| 30 : base(initializer) |
| 31 { |
| 32 } |
| 33 |
| 34 public override AuthorizationCodeRequestUrl CreateAuthorizationCodeReque
st(string redirectUri) |
| 35 { |
| 36 return new GoogleAuthorizationCodeRequestUrl(new Uri(AuthorizationSe
rverUrl)) |
| 37 { |
| 38 ClientId = ClientSecrets.ClientId, |
| 39 Scope = string.Join(" ", Scopes), |
| 40 RedirectUri = redirectUri |
| 41 }; |
| 42 } |
| 43 |
| 44 /// <summary>An initializer class for Google authorization code flow. </
summary> |
| 45 public new class Initializer : AuthorizationCodeFlow.Initializer |
| 46 { |
| 47 /// <summary> |
| 48 /// Constructs a new initializer. Sets Authorization server URL to· |
| 49 /// <seealso cref="GoogleAuthConsts.AuthorizationUrl"/>, and Token s
erver URL to· |
| 50 /// <seealso cref="GoogleAuthConsts.TokenUrl"/>. |
| 51 /// </summary> |
| 52 public Initializer() |
| 53 : base(GoogleAuthConsts.AuthorizationUrl, GoogleAuthConsts.Token
Url) |
| 54 { |
| 55 } |
| 56 } |
| 57 } |
| 58 } |
OLD | NEW |