public boolean populateTokenTargetId()

in core/src/main/java/com/microsoft/alm/auth/pat/VsoAzureAuthority.java [127:155]


    public boolean populateTokenTargetId(final URI targetUri, final Token accessToken) {
        Debug.Assert(targetUri != null && targetUri.isAbsolute(), "The targetUri parameter is null or invalid");
        Debug.Assert(accessToken != null && !StringHelper.isNullOrWhiteSpace(accessToken.Value)
                && (accessToken.Type == TokenType.Access || accessToken.Type == TokenType.Federated),
                "The accessToken parameter is null or invalid");

        logger.debug("VsoAzureAuthority::populateTokenTargetId");

        String resultId = null;
        try {
            // request to the VSO deployment data end-point
            final String content = readConnectionDataRequest(targetUri, accessToken);


            resultId = parseInstanceIdFromJson(content);
        } catch (final IOException e) {
            logger.debug("   server returned " + e.getMessage());
        }

        final AtomicReference<UUID> instanceId = new AtomicReference<UUID>();
        if (Guid.tryParse(resultId, instanceId)) {
            logger.debug("   target identity is " + resultId);
            accessToken.setTargetIdentity(instanceId.get());

            return true;
        }

        return false;
    }