Uses idToken to retrieve the user account information from GITkit service.

@param idToken
336637
public JSONObject getAccountInfo(String idToken)
      throws GitkitClientException, GitkitServerException {
    try {
      // Uses idToken to make the server call to GITKit
      JSONObject params = new JSONObject().put("idToken", idToken);
      return invokeGoogle2LegOauthApi("getAccountInfo", params);
    } catch (JSONException e) {
      throw new GitkitServerException("OAuth API failed");
    }
  }
856401
private Identity fetch(final String token) throws IOException {
        // @checkstyle LineLength (1 line)
        final String uri = this.apihref
            .with("oauth2_access_token", token)
            .with("format", "json")
            .toString();
        return PsLinkedin.parse(
            new JdkRequest(uri)
                .header("accept", "application/json")
                .fetch().as(RestResponse.class)
                .assertStatus(HttpURLConnection.HTTP_OK)
                .as(JsonResponse.class).json().readObject()
        );
    }
705608
protected LexIdentifierToken lastIdToken() throws ParserException,
			LexException
	{
		LexToken tok = reader.getLast();

		if (tok.type == VDMToken.IDENTIFIER)
		{
			LexIdentifierToken id = (LexIdentifierToken) tok;

			if (id.isOld())
			{
				throwMessage(2295, "Can't use old name here", tok);
			}

			return id;
		}

		throwMessage(2058, "Expecting Identifier");
		return null;
	}
1162114
public function retrieveByToken($identifier, $token)
    {
        $user = $this->getGenericUser(
            $this->conn->table($this->table)->find($identifier)
        );

        return $user && $user->getRememberToken() && hash_equals($user->getRememberToken(), $token)
                    ? $user : null;
    }
392676
def GetUserById(self, local_id):
    
    user = self.rpc_helper.GetAccountInfoById(local_id)
    return GitkitUser.FromApiResponse(user)
365652
public GitkitUser validateTokenInRequest(HttpServletRequest request)
      throws GitkitClientException {
    Cookie[] cookies = request.getCookies();
    if (cookieName == null || cookies == null) {
      return null;
    }

    for (Cookie cookie : cookies) {
      if (cookieName.equals(cookie.getName())) {
        return validateToken(cookie.getValue());
      }
    }
    return null;
  }
117172
private void saveTokenFromResponse(Response response) {
        try {
            JSONObject responseJSON = ((ResponseImpl)response).getResponseJSON();

            String accessToken = responseJSON.getString("access_token");
            String idToken = responseJSON.getString("id_token");

            //save the tokens
            preferences.accessToken.set(accessToken);
            preferences.idToken.set(idToken);

            //save the user identity separately
            String[] idTokenData = idToken.split("\\.");
            byte[] decodedIdTokenData = Base64.decode(idTokenData[1], Base64.DEFAULT);
            String decodedIdTokenString = new String(decodedIdTokenData);
            JSONObject idTokenJSON = new JSONObject(decodedIdTokenString);

            if (idTokenJSON.has("imf.user")) {
                preferences.userIdentity.set(idTokenJSON.getJSONObject("imf.user"));
            }

            logger.debug("token successfully saved");
        } catch (Exception e) {
            throw new RuntimeException("Failed to save token from response", e);
        }
    }
1260802
private IdentifierToken eatId() {
    if (peekId()) {
      return eatIdOrKeywordAsId();
    } else {
      reportExpectedError(peekToken(), TokenType.IDENTIFIER);
      if (peekIdOrKeyword()) {
        return eatIdOrKeywordAsId();
      } else {
        return null;
      }
    }
  }
740156
public void cache(OidcTokenImplBase token) { //(IdToken token) {

        String jti = token.getJwtId();
        if (jti == null) {
            return;
        }
        String key = getCacheKey(token);
        long tokenExp = token.getExpirationTimeSeconds() * 1000; // milliseconds
        if (tokenExp == 0) { // in case it's not set, let's give it one hour
            tokenExp = (new Date()).getTime() + 60 * 60 * 1000; // 1 hour
        }
        primaryTable.put(key, Long.valueOf(tokenExp));
    }
649833
public static boolean forgetIDTokensForServer(URL serverURL, TokenStore tokenStore) {
        OpenIDConnectAuthorizer authorizer = new OpenIDConnectAuthorizer(null, tokenStore);
        authorizer.setRemoteURL(serverURL);
        // Deliberately don't set auth.localUUID. This will leave kSecAttrAccount unset in the
        // dictionary passed to SecItemDelete, deleting keychain items for all accounts (databases).
        return authorizer.deleteTokens();
    }
790647
public void handleUserExist(Branch branch) {
        if (callback_ != null) {
            callback_.onInitFinished(branch.getFirstReferringParams(), null);
        }
    }
645630
public static String getUserNameFromToken(String authToken) {
        if (null == authToken) {
            return null;
        }

        return authToken.split(TOKEN_SEPARATOR)[0];
    }
176048
protected synchronized void retrieveToken() {

		log.debug("OAuthTokenManager.retrieveToken");

		if (token == null || (Long.valueOf(token.getExpiration()) < System.currentTimeMillis() / 1000L)) {

			log.debug("Token is null, retrieving initial token from provider");
			boolean tokenRequest = true;
			int retryCount = 0;

			while (tokenRequest && retryCount < this.iamMaxRetry) {
				try {
					++retryCount;
					token = provider.retrieveToken();
					tokenRequest = false;
				} catch (OAuthServiceException exception) {
					log.debug("Exception retrieving IAM token. Returned status code " + exception.getStatusCode()
							+ "Retry attempt " + retryCount);
					tokenRequest = shouldRetry(exception.getStatusCode()) ? true : false;
					if (!tokenRequest || retryCount == this.iamMaxRetry)
						throw exception;
				}
			}

			if(null == token) throw new OAuthServiceException("Null token returned by the Token Provider");

			cacheToken(token);
		}
	}
382385
def account_post_init(remote, token=None):
    """"""
    gh = GitHubAPI(user_id=token.remote_account.user_id)
    repos = [r.id for r in gh.api.repositories() if r.permissions['admin']]
    sync_hooks.delay(token.remote_account.user_id, repos)
93192
public Authentication verifyAccessToken(String accessToken) throws InvalidTokenException, TokenExpiredException{
        CacheProvider cp = cp();

        Authentication authc = cp.get(accessToken);
        if(null != authc) {
            if(!authc.isExpired()) {
                return authc;
            }else{
                cp.remove(accessToken);
            }
        }

        boolean jwt = checkJwtToken(accessToken);
        if(jwt) {
            authc = tp().verifyJwtAccessToken(accessToken);
        }else{
            authc = tp().verifyBearerAccessToken(accessToken);
        }

        cp.put(accessToken, authc, authc.getExpires());

        return authc;
    }
524894
public FutureData<Token> getToken(String identity, String service) {
        FutureData<Token> future = new FutureData<>();
        URI uri = newParams().put("id", identity)
                .forURL(config.newAPIEndpointURI(IDENTITY + "/" + identity + "/token/" + service));
        Request request = config.http().
                GET(uri, new PageReader(newRequestCallback(future, new Token(), config)));
        performRequest(future, request);
        return future;
    }
557390
private String FCMGetFreshToken(final String senderID) {
        String token = null;
        try {
            if(senderID != null){
                getConfigLogger().verbose(getAccountId(), "FcmManager: Requesting a FCM token with Sender Id - "+senderID);
                token = FirebaseInstanceId.getInstance().getToken(senderID, FirebaseMessaging.INSTANCE_ID_SCOPE);
            }else {
                getConfigLogger().verbose(getAccountId(), "FcmManager: Requesting a FCM token");
                token = FirebaseInstanceId.getInstance().getToken();
            }
            getConfigLogger().info(getAccountId(),"FCM token: "+token);
        } catch (Throwable t) {
            getConfigLogger().verbose(getAccountId(), "FcmManager: Error requesting FCM token", t);
        }
        return token;
    }