Lines Matching refs:oauth2
7 * OAuth2 class that handles retrieval/storage of an OAuth2 token.
11 * chrome-extensions in OAuth2.
22 /** @type {remoting.OAuth2} */
23 remoting.oauth2 = null;
27 remoting.OAuth2 = function() {
32 remoting.OAuth2.prototype.KEY_REFRESH_TOKEN_ = 'oauth2-refresh-token';
34 remoting.OAuth2.prototype.KEY_ACCESS_TOKEN_ = 'oauth2-access-token';
36 remoting.OAuth2.prototype.KEY_XSRF_TOKEN_ = 'oauth2-xsrf-token';
38 remoting.OAuth2.prototype.KEY_EMAIL_ = 'remoting-email';
40 // Constants for parameters used in retrieving the OAuth2 credentials.
42 remoting.OAuth2.prototype.SCOPE_ =
49 * @return {string} OAuth2 redirect URI.
51 remoting.OAuth2.prototype.getRedirectUri_ = function() {
58 remoting.OAuth2.prototype.getClientId_ = function() {
65 remoting.OAuth2.prototype.getClientSecret_ = function() {
70 * @return {string} OAuth2 authentication URL.
72 remoting.OAuth2.prototype.getOAuth2AuthEndpoint_ = function() {
77 remoting.OAuth2.prototype.isAuthenticated = function() {
89 remoting.OAuth2.prototype.clear = function() {
102 remoting.OAuth2.prototype.setRefreshToken_ = function(token) {
111 remoting.OAuth2.prototype.getRefreshToken = function() {
125 remoting.OAuth2.prototype.clearRefreshToken_ = function() {
135 remoting.OAuth2.prototype.setAccessToken_ = function(token, expiration) {
159 remoting.OAuth2.prototype.getAccessTokenInternal_ = function() {
183 remoting.OAuth2.prototype.needsNewAccessToken_ = function() {
201 remoting.OAuth2.prototype.clearAccessToken_ = function() {
206 * Update state based on token response from the OAuth2 /token endpoint.
214 remoting.OAuth2.prototype.onAccessToken_ =
221 * Update state based on token response from the OAuth2 /token endpoint.
230 remoting.OAuth2.prototype.onTokens_ =
238 * Redirect page to get a new OAuth2 Refresh Token.
242 remoting.OAuth2.prototype.doAuthRedirect = function() {
243 /** @type {remoting.OAuth2} */
278 console.error('Invalid oauth2 response.');
290 * @param {string} code The OAuth2 authorization code.
295 remoting.OAuth2.prototype.exchangeCodeForToken = function(code, state, onDone) {
299 // Invalid XSRF token, or unexpected OAuth2 redirect. Abort.
323 remoting.OAuth2.prototype.callWithToken = function(onOk, onError) {
348 remoting.OAuth2.prototype.getEmail = function(onOk, onError) {
354 /** @type {remoting.OAuth2} */
372 remoting.OAuth2.prototype.getCachedEmail = function() {