-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better documentation for perform attestation #31966
Comments
@taxa-chris I agree that the message isn't particularly helpful here, but my (limited) understanding is that it is saying whatever credentials it's using via DefaultAzureCredential doesn't have the proper RBAC permissions to make the call to It may help to enable Identity logging to figure out what service principal is being used so you can confirm that it is assigned the proper permissions to make that call. |
Hi @taxa-chris. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue. |
Here is the full output I get when running with identity logging enabled:
And here is the code i'm running: const {
DefaultAzureCredential,
ClientSecretCredential,
} = require("@azure/identity");
const {
AttestationClient,
AttestationAdministrationClient,
KnownAttestationType,
} = require("@azure/attestation");
const { TokenCredential, isTokenCredential } = require("@azure/core-auth");
const { setLogLevel } = require("@azure/logger");
setLogLevel("info");
const AZURE_CLIENT_ID="[redacted]";
const AZURE_CLIENT_SECRET="[redacted]";
const AZURE_TENANT_ID="[redacted]";
const AAS_URL = "https://attestation2.eus.attest.azure.net/";
async function test_env() {
const endpoint = AAS_URL;
const credentials = new ClientSecretCredential(AZURE_TENANT_ID,
AZURE_CLIENT_ID,
AZURE_CLIENT_SECRET,
{ authorityHost: AAS_URL },
);
const client = new AttestationClient(endpoint, { credentials: credentials });
// Retrieve the set of attestation policy signers from the attestation client.
const attestationSigners = await client.getAttestationSigners();
//console.log("===============================");
//console.log(attestationSigners);
const admin_credential = new DefaultAzureCredential();
const admin_client = new AttestationAdministrationClient(endpoint, admin_credential);
const policyResponse = await admin_client.getPolicy(
KnownAttestationType.SgxEnclave,
);
console.log("===============================");
console.log(policyResponse);
}
test_env(); |
Is your feature request related to a problem? Please describe.
The docs say to perform attestation you need to run this snippet:
But when I do that, I get this error:
Describe the solution you'd like
Better explanation about what that error means, and how to attach a "JWT bearer token" to my code. Nowhere in the docs does it say anything about attaching a JWT bearer token.
Describe alternatives you've considered
Looking through the docs for a description of how to include a "JWT bearer token"
The text was updated successfully, but these errors were encountered: