Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(644)

Side by Side Diff: Src/GoogleApis.Auth.WP/OAuth2/GoogleWebAuthorizationBroker.cs

Issue 176220043: Issue 471: Support WP8.1 (Closed) Base URL: https://google-api-dotnet-client.googlecode.com/hg/
Patch Set: minor Created 9 years, 8 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 Copyright 2013 Google Inc 2 Copyright 2013 Google Inc
3 3
4 Licensed under the Apache License, Version 2.0 (the "License"); 4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with 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 6 You may obtain a copy of the License at
7 7
8 http://www.apache.org/licenses/LICENSE-2.0 8 http://www.apache.org/licenses/LICENSE-2.0
9 9
10 Unless required by applicable law or agreed to in writing, software 10 Unless required by applicable law or agreed to in writing, software
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 /// they revoked the token. 80 /// they revoked the token.
81 /// </summary> 81 /// </summary>
82 /// <param name="userCredential">The current user credential. Its <see c ref="UserCredential.Token"/> will be 82 /// <param name="userCredential">The current user credential. Its <see c ref="UserCredential.Token"/> will be
83 /// updated. </param> 83 /// updated. </param>
84 /// <param name="taskCancellationToken">Cancellation token to cancel an operation.</param> 84 /// <param name="taskCancellationToken">Cancellation token to cancel an operation.</param>
85 public static async Task ReauthorizeAsync(UserCredential userCredential, 85 public static async Task ReauthorizeAsync(UserCredential userCredential,
86 CancellationToken taskCancellationToken) 86 CancellationToken taskCancellationToken)
87 { 87 {
88 var installedApp = new AuthorizationCodeWPInstalledApp(userCredentia l.Flow); 88 var installedApp = new AuthorizationCodeWPInstalledApp(userCredentia l.Flow);
89 // Create an authorization code installed app instance and authorize the user. 89 // Create an authorization code installed app instance and authorize the user.
90 UserCredential newUserCredential = await installedApp.AuthorizeAsync (userCredential.UderId, 90 UserCredential newUserCredential = await installedApp.AuthorizeAsync (userCredential.UserId,
91 taskCancellationToken).ConfigureAwait(false); 91 taskCancellationToken).ConfigureAwait(false);
92 userCredential.Token = newUserCredential.Token; 92 userCredential.Token = newUserCredential.Token;
93 } 93 }
94 94
95 /// <summary>The core logic for asynchronously authorizing the specified user.</summary> 95 /// <summary>The core logic for asynchronously authorizing the specified user.</summary>
96 /// <param name="initializer">The authorization code initializer.</param > 96 /// <param name="initializer">The authorization code initializer.</param >
97 /// <param name="scopes"> 97 /// <param name="scopes">
98 /// The scopes which indicate the Google API access your application is requesting. 98 /// The scopes which indicate the Google API access your application is requesting.
99 /// </param> 99 /// </param>
100 /// <param name="user">The user to authenticate.</param> 100 /// <param name="user">The user to authenticate.</param>
101 /// <param name="taskCancellationToken">Cancellation token to cancel an operation.</param> 101 /// <param name="taskCancellationToken">Cancellation token to cancel an operation.</param>
102 /// <returns>User credential.</returns> 102 /// <returns>User credential.</returns>
103 private static async Task<UserCredential> AuthorizeAsyncCore( 103 private static async Task<UserCredential> AuthorizeAsyncCore(
104 GoogleAuthorizationCodeFlow.Initializer initializer, IEnumerable<str ing> scopes, string user, 104 GoogleAuthorizationCodeFlow.Initializer initializer, IEnumerable<str ing> scopes, string user,
105 CancellationToken taskCancellationToken) 105 CancellationToken taskCancellationToken)
106 { 106 {
107 initializer.Scopes = scopes; 107 initializer.Scopes = scopes;
108 initializer.DataStore = new StorageDataStore(); 108 initializer.DataStore = new StorageDataStore();
109 109
110 var installedApp = new AuthorizationCodeWPInstalledApp(new GoogleAut horizationCodeFlow(initializer)); 110 var installedApp = new AuthorizationCodeWPInstalledApp(new GoogleAut horizationCodeFlow(initializer));
111 return await installedApp.AuthorizeAsync(user, taskCancellationToken ).ConfigureAwait(false); 111 return await installedApp.AuthorizeAsync(user, taskCancellationToken ).ConfigureAwait(false);
112 } 112 }
113 } 113 }
114 } 114 }
OLDNEW
« no previous file with comments | « Src/GoogleApis.Auth.WP/GoogleApis.Auth.WP.csproj ('k') | Src/GoogleApis.Auth.WP/packages.config » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b