[go: nahoru, domu]

Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(2675)
Delta Between Two Patch Sets: Src/GoogleApis.Auth.WP/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 II Created 10 years, 2 months ago
Right Patch Set: Gus' comments Created 10 years, 1 month 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 { 69 {
70 var initializer = new GoogleAuthorizationCodeFlow.Initializer 70 var initializer = new GoogleAuthorizationCodeFlow.Initializer
71 { 71 {
72 ClientSecretsStream = clientSecretsStream, 72 ClientSecretsStream = clientSecretsStream,
73 }; 73 };
74 74
75 return await AuthorizeAsyncCore(initializer, scopes, user, taskCance llationToken).ConfigureAwait(false); 75 return await AuthorizeAsyncCore(initializer, scopes, user, taskCance llationToken).ConfigureAwait(false);
76 } 76 }
77 77
78 /// <summary> 78 /// <summary>
79 /// Reauthorizes asynchronously the user. This method should be called i f the user wants to reauthorize after 79 /// Asynchronously reauthorizes the user. This method should be called i f the users want to authorize after
80 /// he already 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"/></param> 82 /// <param name="userCredential">The current user credential. Its <see c ref="UserCredential.Token"/> will be
83 /// will be updated. 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.UderId,
91 taskCancellationToken).ConfigureAwait(false); 91 taskCancellationToken).ConfigureAwait(false);
92 userCredential.Token = newUserCredential.Token; 92 userCredential.Token = newUserCredential.Token;
93 } 93 }
(...skipping 11 matching lines...) Expand all
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 }
LEFTRIGHT

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