actions / actions/toolkit

OidcClient.getCall failing in self-hosted Runners.

Open
#1,787 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
5.9k
Forks
1.8k
PR merge metrics
No merged PRs in 30d

Description

Coming from this post: https://github.com/Azure/login/issues/477

Environments

  • GHES 3.11.5 in an Azure VM along with,
  • a self-hosted runner in an Azure VM with the software provided by the GHES instance.

Issue:

  • When Azure/login is used on a self-hosted runner, the job is unable to access the id-token variable's permissions. id-token has been set to both Write and Write-All in many iterations of the job to no success. Please make sure to give write permissions to id-token in the workflow.
  • the azure/login v2.1.1 action fails at line 570, the try-catch sends back Login failed with Error: Error message: Cannot read properties of undefined (reading 'message'). Double check if the 'auth-type' is correct. Refer to https://github.com/Azure/login#readme for more information.
  • the OIDC token URL appears to be generated , but
  • it fails at line 565: const id_token = yield OidcClient.getCall(id_token_url);

Following advice from this post: https://github.com/Azure/login/issues/283

  • Both endpoints are available from the internet.
  • They are available when using a curl - v command from the runner machine.

However this still results in a failed run with the following information:

The id_token_url (Line 559) variable , when visited via a browser from my machine, or curl -v from the gitRunner machine is always the same response: The user 'System:PublicAccess;aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa' is not authorized to access this resource.
The person assigned to my issue suggested I bring this up here.
Thanks for any assistance.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with OidcClient.getCall and the azure/login v2.1.1 flow around lines 559-570. Reproduce the OIDC request on the reported GHES 3.11.5 self-hosted runner, comparing the generated URL and authorization response with the curl results. Done means the failure is explained and a focused fix or actionable limitation is documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, github-actions, typescript
Domain
authentication, ci-cd
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.