Lines Matching full: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_REFRESH_TOKEN_REVOKABLE_ =
35 'oauth2-refresh-token-revokable';
37 remoting.OAuth2.prototype.KEY_ACCESS_TOKEN_ = 'oauth2-access-token';
39 remoting.OAuth2.prototype.KEY_XSRF_TOKEN_ = 'oauth2-xsrf-token';
41 remoting.OAuth2.prototype.KEY_EMAIL_ = 'remoting-email';
43 // Constants for parameters used in retrieving the OAuth2 credentials.
45 remoting.OAuth2.prototype.SCOPE_ =
52 * @return {string} OAuth2 redirect URI.
54 remoting.OAuth2.prototype.getRedirectUri_ = function() {
61 remoting.OAuth2.prototype.getClientId_ = function() {
68 remoting.OAuth2.prototype.getClientSecret_ = function() {
73 * @return {string} OAuth2 authentication URL.
75 remoting.OAuth2.prototype.getOAuth2AuthEndpoint_ = function() {
80 remoting.OAuth2.prototype.isAuthenticated = function() {
92 remoting.OAuth2.prototype.clear = function() {
108 remoting.OAuth2.prototype.setRefreshToken_ = function(token) {
125 remoting.OAuth2.prototype.exportRefreshToken = function() {
134 remoting.OAuth2.prototype.getRefreshToken_ = function() {
148 remoting.OAuth2.prototype.clearRefreshToken_ = function() {
162 remoting.OAuth2.prototype.setAccessToken_ = function(token, expiration) {
186 remoting.OAuth2.prototype.getAccessTokenInternal_ = function() {
210 remoting.OAuth2.prototype.needsNewAccessToken_ = function() {
228 remoting.OAuth2.prototype.clearAccessToken_ = function() {
233 * Update state based on token response from the OAuth2 /token endpoint.
241 remoting.OAuth2.prototype.onAccessToken_ =
248 * Update state based on token response from the OAuth2 /token endpoint.
257 remoting.OAuth2.prototype.onTokens_ =
265 * Redirect page to get a new OAuth2 Refresh Token.
269 remoting.OAuth2.prototype.doAuthRedirect = function() {
270 /** @type {remoting.OAuth2} */
305 console.error('Invalid oauth2 response.');
317 * @param {string} code The OAuth2 authorization code.
322 remoting.OAuth2.prototype.exchangeCodeForToken = function(code, state, onDone) {
326 // Invalid XSRF token, or unexpected OAuth2 redirect. Abort.
347 remoting.OAuth2.prototype.revokeToken_ = function(token) {
365 remoting.OAuth2.prototype.callWithToken = function(onOk, onError) {
390 remoting.OAuth2.prototype.getEmail = function(onOk, onError) {
396 /** @type {remoting.OAuth2} */
414 remoting.OAuth2.prototype.getCachedEmail = function() {