-
Notifications
You must be signed in to change notification settings - Fork 208
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
Unable to authenticate using OIDC workload identity when adding attribute condition #77
Comments
This comment was edited to fix an error, to prevent people from blindly copy-pasting. I think you need to specify which attribute you're mapping. The IAM policy should be:
You also need to make sure you've mapped |
I have fixed the mapping. (i tried with both).
I am so sorry- i accidentally removed too much when editing ticket. my IAM policy is setup to:
Still getting same error:
I hope its not cacheing.. |
The original error was failing to generate an ID token, but this error is failing to generate an access token. Please try to limit redaction as it makes it very difficult to debug. It also doesn't make sense as you've set My best guess is that you did not wait long enough. Try again in ~5min. IAM propagation on Workload Identity is eventually consistent. |
Apologies for the accidental redaction. Also, you are correct - initially, I had access_token and was trying to troubleshoot with id_token. I did everything from scratch again.
Error:
|
@sethvargo could you please confirm auth should work with attribute conditions on a private repository? I can close this ticket if you can confirm this. Thanks. |
@rushminatorr the attribute conditions will work on a private repo (I just tested it), but I think the problem is the "slash" in the org/repo. If you want to admit all repos in an organization, map on gcloud iam service-accounts add-iam-policy-binding "my-service-account@${PROJECT_ID}.iam.gserviceaccount.com" \
--project "${PROJECT_ID}" \
--role="roles/iam.workloadIdentityUser" \
--member="principalSet://iam.googleapis.com/${WORKLOAD_IDENTITY_POOL_ID}/attribute.repository_owner/${ORG_NAME}" You also need to make sure that I just confirmed this setup is working for me, in a private repository, with the |
okay thank you! i will test this. |
This definitely should be mentioned in the configuration docs. I've just struggled the same trouble. |
I really struggleded several days with this and thankfully i found #77 (comment) big thanks to @sethvargo ❤ as @dobromyslov already said, this should be documented so I went ahead and created added a paragrah for this use case --------- Signed-off-by: Daniel Brown <[email protected]>
This worked for me |
TL;DR
Authentication is successfull when principleSet is set to:
//iam.googleapis.com/projects/xxxxxxx/locations/global/workloadIdentityPools/rush3-pool/*
But fails when I limit it to a private repo under an org.
//iam.googleapis.com/projects/xxxxxxx/locations/global/workloadIdentityPools/rush3-pool/<GITHUB_ORG>/*
Expected behavior
Authenticate with specific private repository.
Observed behavior
Action YAML
Additional information
I have also followed steps described here: #36
The text was updated successfully, but these errors were encountered: