Any examples using a managed identity for authentication?
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Documentation
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- azure, csharp, playwright
- Domain
- authentication, cloud, documentation
Research direction
Start from the C# managed-identity token acquisition snippet in the issue and verify the reported 401 against the Azure Playwright Testing service and the 2025-09-01 API version. Done means a repository guide or sample explains the required managed-identity setup, token scope, and working connection flow.
Written by the indexing model from the issue text.
Description
Attempt to use a managed identity but getting a 401, was hoping there was a guide or sample that could do this.
Have it working using a standard token (although took a long time to realise my api version was using the old 2023 preview format instead of the 2025-09-01 one).
here's my rough method of trying to get the token, i'm assuming this either doesn't work at all or I'm guessing it for the wrong subject or similar.
TokenCredential credential;
if (string.IsNullOrEmpty(managedIdentityClientId))
{
throw new Exception("Managed identity client ID is not configured.");
}
_logger.LogInformation("Using user-assigned managed identity with client ID: {ClientId}", managedIdentityClientId);
credential = new DefaultAzureCredential(new DefaultAzureCredentialOptions
{
ManagedIdentityClientId = managedIdentityClientId
});
// Get access token for Azure Playwright Testing service
// The scope for Azure Playwright Testing is: https://playwright.microsoft.com/.default
var tokenRequestContext = new TokenRequestContext(new[] { "https://playwright.microsoft.com/.default" });
var accessToken = await credential.GetTokenAsync(tokenRequestContext, CancellationToken.None);
var wsEndpoint = $"{serviceUrl}?runId={Uri.EscapeDataString(runId)}&os={os}&api-version={apiVersion}";
_logger.LogInformation($"Access token: {accessToken.Token}");
var options = new BrowserTypeConnectOptions
{
Timeout = 3 * 60 * 1000, // 3 minutes
Headers = new Dictionary<string, string>
{
{ "Authorization", $"Bearer {accessToken.Token}" }
},
ExposeNetwork = "<loopback>", // Use loopback to expose network
};
- Dominant language
- No language data
- Stars
- 14
- Forks
- 18
- Avg merge
- 1h 18m
- Merged PRs (30d)
- 2
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Azure/playwright-workspaces
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 52/100
Azure/playwright-workspaces#46 · 1 comment ·
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 20/100
Azure/playwright-workspaces#43 · 1 comment ·
-
enhancement
Azure/playwright-workspaces#33 · 2 reactions · 1 assignee ·
All issues in Azure/playwright-workspaces
Similar issues
-
documentation help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
clerk/javascript#9852 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
AiursoftWeb/AnduinOS-2#19 ·
-
area/config comp/agent P3 sweeper:risk-security-boundary type/feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
NousResearch/hermes-agent#118734 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
AXERA-TECH/ax-llm#75 ·