in e2etest/GuestProxyAgentTest/Utilities/TestCommonUtilities.cs [103:116]
public static AccessToken GetAccessTokenFromEnv(string envName)
{
var tokenString = Environment.GetEnvironmentVariable(envName);
if (string.IsNullOrEmpty(tokenString))
{
throw new Exception("Failed to get the access token from environment variable: " + envName);
}
var model = JsonConvert.DeserializeObject<TokenEnvModel>(tokenString);
if (model == null)
{
throw new Exception("Failed to deserialize access token json object: " + tokenString);
}
return new AccessToken(model.AccessToken, DateTimeOffset.Parse(model.ExpiresOn));
}