in aliyun-net-credentials/Utils/AuthUtils.cs [63:92]
public static string GetOIDCToken(string OIDCTokenFilePath)
{
byte[] buffer;
if (!File.Exists(OIDCTokenFilePath))
{
throw new CredentialException("OIDCTokenFilePath " + OIDCTokenFilePath + " does not exist.");
}
try
{
using (var inStream = new FileStream(OIDCTokenFilePath, FileMode.Open, FileAccess.Read))
{
buffer = new byte[inStream.Length];
inStream.Read(buffer, 0, buffer.Length);
}
oidcToken = Encoding.UTF8.GetString(buffer);
}
catch (UnauthorizedAccessException)
{
throw new CredentialException("OIDCTokenFilePath " + OIDCTokenFilePath + " cannot be read.");
}
catch (SecurityException)
{
throw new CredentialException("Security Exception: Do not have the required permission. " + "OIDCTokenFilePath " + OIDCTokenFilePath);
}
catch (IOException e)
{
throw new CredentialException(e.Message);
}
return oidcToken;
}