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

Delta Between Two Patch Sets: Src/GoogleApis.Auth.WinRT/OAuth2/GoogleWebAuthorizationBroker.cs

Issue 94340043: Issue 463: Provide a signout\logout method (Closed) Base URL: https://google-api-dotnet-client.googlecode.com/hg/
Left Patch Set: minor III Created 9 years, 10 months ago
Right Patch Set: Gus' comments Created 9 years, 10 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:
Left: Side by side diff | Download
Right: Side by side diff | Download
LEFTRIGHT
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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 ClientSecrets = clientSecrets, 67 ClientSecrets = clientSecrets,
68 Scopes = scopes, 68 Scopes = scopes,
69 DataStore = new StroageDataStore() 69 DataStore = new StroageDataStore()
70 }; 70 };
71 71
72 var installedApp = new AuthorizationCodeWinRTInstalledApp(new Google AuthorizationCodeFlow(initializer)); 72 var installedApp = new AuthorizationCodeWinRTInstalledApp(new Google AuthorizationCodeFlow(initializer));
73 return await installedApp.AuthorizeAsync(user, taskCancellationToken ).ConfigureAwait(false); 73 return await installedApp.AuthorizeAsync(user, taskCancellationToken ).ConfigureAwait(false);
74 } 74 }
75 75
76 /// <summary> 76 /// <summary>
77 /// Reauthorizes asynchronously the user. This method should be called i f the user wants to reauthorize after 77 /// Asynchronously reauthorizes the user. This method should be called i f the users want to authorize after
class 2014/05/12 18:00:53 Same as before: "Asynchronously reauthorizes the
peleyal 2014/05/12 20:26:34 Done.
78 /// he already revoked the token. 78 /// they revoked the token.
79 /// </summary> 79 /// </summary>
80 /// <param name="userCredential">The current user credential. Its <see c ref="UserCredential.Token"/></param> 80 /// <param name="userCredential">The current user credential. Its <see c ref="UserCredential.Token"/> will be
81 /// will be updated. 81 /// updated. </param>
class 2014/05/12 18:00:53 Put the closing </param> tag after the text "will
peleyal 2014/05/12 20:26:34 Done.
82 /// <param name="taskCancellationToken">Cancellation token to cancel an operation.</param> 82 /// <param name="taskCancellationToken">Cancellation token to cancel an operation.</param>
83 public static async Task ReauthorizeAsync(UserCredential userCredential, 83 public static async Task ReauthorizeAsync(UserCredential userCredential,
84 CancellationToken taskCancellationToken) 84 CancellationToken taskCancellationToken)
85 { 85 {
86 var installedApp = new AuthorizationCodeWinRTInstalledApp(userCreden tial.Flow); 86 var installedApp = new AuthorizationCodeWinRTInstalledApp(userCreden tial.Flow);
87 // Create an authorization code installed app instance and authorize the user. 87 // Create an authorization code installed app instance and authorize the user.
88 UserCredential newUserCredential = await installedApp.AuthorizeAsync ( 88 UserCredential newUserCredential = await installedApp.AuthorizeAsync (
89 userCredential.UderId, taskCancellationToken).ConfigureAwait(fal se); 89 userCredential.UderId, taskCancellationToken).ConfigureAwait(fal se);
90 userCredential.Token = newUserCredential.Token; 90 userCredential.Token = newUserCredential.Token;
91 } 91 }
92 92
93 /// <summary>Loads the client secrets from the given URI.</summary> 93 /// <summary>Loads the client secrets from the given URI.</summary>
94 /// <param name="clientSecretsUri">The client secrets URI.</param> 94 /// <param name="clientSecretsUri">The client secrets URI.</param>
95 /// <returns>Client secrets.</returns> 95 /// <returns>Client secrets.</returns>
96 private static async Task<ClientSecrets> LoadClientSecrets(Uri clientSec retsUri) 96 private static async Task<ClientSecrets> LoadClientSecrets(Uri clientSec retsUri)
97 { 97 {
98 var file = await StorageFile.GetFileFromApplicationUriAsync(clientSe cretsUri); 98 var file = await StorageFile.GetFileFromApplicationUriAsync(clientSe cretsUri);
99 var content = await FileIO.ReadTextAsync(file); 99 var content = await FileIO.ReadTextAsync(file);
100 100
101 using (var stream = new MemoryStream(Encoding.UTF8.GetBytes(content) )) 101 using (var stream = new MemoryStream(Encoding.UTF8.GetBytes(content) ))
102 { 102 {
103 return GoogleClientSecrets.Load(stream).Secrets; 103 return GoogleClientSecrets.Load(stream).Secrets;
104 } 104 }
105 } 105 }
106 } 106 }
107 } 107 }
LEFTRIGHT

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