/* AccessTokenInterface
517161
public function getAccessToken($access_token)
    {
        return isset($this->accessTokens[$access_token]) ? $this->accessTokens[$access_token] : false;
    }
923510
void advanceContextToNextPortableToken(int factoryId, int classId, int version) throws IOException {
        cd = serializer.setupPositionAndDefinition(in, factoryId, classId, version);
        initFinalPositionAndOffset(in, cd);
    }
1186814
private AstNode propertyAccess(int tt, AstNode pn)
            throws IOException
    {
        if (pn == null) codeBug();
        int memberTypeFlags = 0, lineno = ts.lineno, dotPos = ts.tokenBeg;
        consumeToken();

        if (tt == Token.DOTDOT) {
            mustHaveXML();
            memberTypeFlags = Node.DESCENDANTS_FLAG;
        }

        if (!compilerEnv.isXmlAvailable()) {
            int maybeName = nextToken();
            if (maybeName != Token.NAME
                    && !(compilerEnv.isReservedKeywordAsIdentifier()
                    && TokenStream.isKeyword(ts.getString(), compilerEnv.getLanguageVersion(), inUseStrictDirective))) {
              reportError("msg.no.name.after.dot");
            }

            Name name = createNameNode(true, Token.GETPROP);
            PropertyGet pg = new PropertyGet(pn, name, dotPos);
            pg.setLineno(lineno);
            return pg;
        }

        AstNode ref = null;  // right side of . or .. operator

        int token = nextToken();
        switch (token) {
          case Token.THROW:
              // needed for generator.throw();
              saveNameTokenData(ts.tokenBeg, "throw", ts.lineno);
              ref = propertyName(-1, "throw", memberTypeFlags);
              break;

          case Token.NAME:
              // handles: name, ns::name, ns::*, ns::[expr]
              ref = propertyName(-1, ts.getString(), memberTypeFlags);
              break;

          case Token.MUL:
              // handles: *, *::name, *::*, *::[expr]
              saveNameTokenData(ts.tokenBeg, "*", ts.lineno);
              ref = propertyName(-1, "*", memberTypeFlags);
              break;

          case Token.XMLATTR:
              // handles: '@attr', '@ns::attr', '@ns::*', '@ns::*',
              //          '@::attr', '@::*', '@*', '@*::attr', '@*::*'
              ref = attributeAccess();
              break;

          case Token.RESERVED: {
              String name = ts.getString();
              saveNameTokenData(ts.tokenBeg, name, ts.lineno);
              ref = propertyName(-1, name, memberTypeFlags);
              break;
          }

          default:
              if (compilerEnv.isReservedKeywordAsIdentifier()) {
                  // allow keywords as property names, e.g. ({if: 1})
                  String name = Token.keywordToName(token);
                  if (name != null) {
                      saveNameTokenData(ts.tokenBeg, name, ts.lineno);
                      ref = propertyName(-1, name, memberTypeFlags);
                      break;
                  }
              }
              reportError("msg.no.name.after.dot");
              return makeErrorNode();
        }

        boolean xml = ref instanceof XmlRef;
        InfixExpression result = xml ? new XmlMemberGet() : new PropertyGet();
        if (xml && tt == Token.DOT)
            result.setType(Token.DOT);
        int pos = pn.getPosition();
        result.setPosition(pos);
        result.setLength(getNodeEnd(ref) - pos);
        result.setOperatorPosition(dotPos - pos);
        result.setLineno(pn.getLineno());
        result.setLeft(pn);  // do this after setting position
        result.setRight(ref);
        return result;
    }
179004
private int getAccess(Collection.Key key) {
	Member member = getMember(ACCESS_PRIVATE, key, false, false);
	if (member == null) return Component.ACCESS_PRIVATE;
	return member.getAccess();
    }
1121699
function callAdoptionAgency(p, token) {
    for (var i = 0; i < AA_OUTER_LOOP_ITER; i++) {
        var formattingElementEntry = aaObtainFormattingElementEntry(p, token, formattingElementEntry);

        if (!formattingElementEntry)
            break;

        var furthestBlock = aaObtainFurthestBlock(p, formattingElementEntry);

        if (!furthestBlock)
            break;

        p.activeFormattingElements.bookmark = formattingElementEntry;

        var lastElement = aaInnerLoop(p, furthestBlock, formattingElementEntry.element),
            commonAncestor = p.openElements.getCommonAncestor(formattingElementEntry.element);

        p.treeAdapter.detachNode(lastElement);
        aaInsertLastNodeInCommonAncestor(p, commonAncestor, lastElement);
        aaReplaceFormattingElement(p, furthestBlock, formattingElementEntry);
    }
}
513208
public function setAccessToken($access_token)
    {
        if (!is_string($access_token)) {
            throw new InvalidArgumentException("Invalid AccessToken type, need string.");
        }
        $cache = $this->config->get('appid') . '_access_token';
        Tools::setCache($cache, $this->access_token = $access_token);
    }
1249473
@Override
  public V putIfAbsentFailure(K key, V value, StoreAccessException e) {
    cleanup(key, e);
    return null;
  }
639005
protected function getUserByToken(AccessTokenInterface $token)
    {
        $response = $this->getHttpClient()->post($this->getUserInfoUrl($this->gatewayUrl, $token));

        return json_decode($response->getBody(), true);
    }
1022936
public RefToken get(int index) throws IndexOutOfBoundsException {
        if (index < 0 || index >= tokens.length) throw new IndexOutOfBoundsException("Illegal index: " + index);
        return tokens[index];
    }
566268
private Mono<AuthenticationResult> acquireAccessTokenFromRefreshToken(String resource, String refreshToken, boolean isMultipleResourceRefreshToken) {
        String authorityUrl = this.environment().activeDirectoryEndpoint() + this.domain();
        ExecutorService executor = Executors.newSingleThreadExecutor();
        Mono<AuthenticationResult> authMono = Mono.defer(() -> {
            AuthenticationContext context;
            try {
                context = new AuthenticationContext(authorityUrl, false, executor);
            } catch (MalformedURLException mue) {
                throw Exceptions.propagate(mue);
            }
            if (proxy() != null) {
                context.setProxy(proxy());
            }
            return Mono.create(callback -> context.acquireTokenByRefreshToken(
                    refreshToken,
                    clientId(),
                    resource,
                    Util.authenticationDelegate(callback)));
        });
        return authMono.doFinally(s -> executor.shutdown());
    }
84930
public function setAccessToken(AccessToken $accessToken)
    {
        $this->accessToken = $accessToken;

        if ($this->tokenUpdatedCallback) {
            call_user_func($this->tokenUpdatedCallback, $accessToken);
        }
    }
960913
protected String generateAccessTokenHash(final AccessToken accessTokenId,
                                             final OidcRegisteredService service) {
        val alg = getConfigurationContext().getIdTokenSigningAndEncryptionService().getJsonWebKeySigningAlgorithm(service);
        val tokenBytes = accessTokenId.getId().getBytes(StandardCharsets.UTF_8);
        if (AlgorithmIdentifiers.NONE.equalsIgnoreCase(alg)) {
            LOGGER.debug("Signing algorithm specified by service [{}] is unspecified", service.getServiceId());
            return EncodingUtils.encodeUrlSafeBase64(tokenBytes);
        }

        val hashAlg = getSigningHashAlgorithm(service);
        LOGGER.debug("Digesting access token hash via algorithm [{}]", hashAlg);
        val digested = DigestUtils.rawDigest(hashAlg, tokenBytes);
        val hashBytesLeftHalf = Arrays.copyOf(digested, digested.length / 2);
        return EncodingUtils.encodeUrlSafeBase64(hashBytesLeftHalf);
    }
338973
@Nonnull
  public static AccessToken createAccessTokenValidFromNow (@Nullable final String sTokenString)
  {
    // Length 66 so that the Base64 encoding does not add the "==" signs
    // Length must be dividable by 3
    final String sRealTokenString = StringHelper.hasText (sTokenString) ? sTokenString : createNewTokenString (66);
    return new AccessToken (sRealTokenString, PDTFactory.getCurrentLocalDateTime (), null, new RevocationStatus ());
  }
1270718
public static String accessToken(String key) {
		if (isKeyParam(key)) {
			String[] keys = key.split(KEY_JOIN);
			if (keys.length == 2) {
				return apiHandler.accessToken(keys[0], keys[1]);
			} else if (keys.length == 1) {
				return apiHandler.accessToken(keys[0]);
			}
		}
		return key;
	}
1023383
public void setAccessToken(String accessToken) {
        for (Authentication auth : authentications.values()) {
            if (auth instanceof OAuth) {
                ((OAuth) auth).setAccessToken(accessToken);
                return;
            }
        }
        throw new RuntimeException("No OAuth2 authentication configured!");
    }
232516
public function getAccessToken($access_token)
    {
        $token = $this->getObjectByType('access_token_table',$access_token);

        return is_null($token) ? false : $token;
    }
1219333
public function getAccessToken($access_token)
    {
        return isset($this->accessTokens[$access_token]) ? $this->accessTokens[$access_token] : null;
    }