# How do I know \_why\_ a build is unauthorized?

**URL:** <https://discuss.circleci.com/t/how-do-i-know-why-a-build-is-unauthorized/36538>\
**Category:** Build Environment\
**Created:** [July 2, 2020, 8:50pm UTC](https://discuss.circleci.com/t/how-do-i-know-why-a-build-is-unauthorized/36538 "2020-07-02T20:50:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![RangerRick](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/rangerrick/32/24272_2.png) [@RangerRick](https://discuss.circleci.com/u/RangerRick)\
**Post date:** [July 2, 2020, 8:50pm UTC](https://discuss.circleci.com/t/how-do-i-know-why-a-build-is-unauthorized/36538/1 "2020-07-02T20:50:41Z")

</div>

We have someone who has submitted a PR to our project, and [the build for it shows as “unauthorized”](https://app.circleci.com/pipelines/github/OpenNMS/opennms/6655/workflows/96b6a0af-85a0-4cfb-a70f-71f75fa1eda5). I have no idea how to make it so it _is_ authorized to run. Is there any feedback at all on why something is unauthorized?

The project is marked open-source, and “Build forked pull requests” is on.

---

<div class="post-metadata">

**Author:** ![yannCI](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/yannci/32/24866_2.png) [@yannCI](https://discuss.circleci.com/u/yannCI)\
**Post date:** [July 17, 2020, 3:37pm UTC](https://discuss.circleci.com/t/how-do-i-know-why-a-build-is-unauthorized/36538/2 "2020-07-17T15:37:15Z")

</div>

👋 Hi @RangerRick,

Looking at your build, I see it the workflows are [restricted to a context](https://circleci.com/docs/2.0/contexts/), which itself is available to `All Members`; this means that **anyone in your organization** can access this specific context at runtime.

However, the user who created the PR doesn’t appear to be a member of your GitHub organization, hence the _UNAUTHORIZED_ outcome.

You could try enabling the _**[Pass Secrets to Builds From Forked Pull Requests](https://circleci.com/docs/2.0/oss/#pass-secrets-to-builds-from-forked-pull-requests)**_ options (under _Project Settings_ \> _Advanced Settings_). But please, consider the **potential security implications** before doing so.

---

<div class="post-metadata">

**Author:** ![RangerRick](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/rangerrick/32/24272_2.png) [@RangerRick](https://discuss.circleci.com/u/RangerRick)\
**Post date:** [July 17, 2020, 6:59pm UTC](https://discuss.circleci.com/t/how-do-i-know-why-a-build-is-unauthorized/36538/3 "2020-07-17T18:59:28Z")

</div>

Oh, so putting someone in a team (and giving them commit access to things) _doesn’t_ count as being authorized? Because `dschlenk` is in 2 different teams that give him access. They are secret though, would making them public be enough, or do I need to add these users as actual org members as well?

---

<div class="post-metadata">

**Author:** ![yannCI](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/yannci/32/24866_2.png) [@yannCI](https://discuss.circleci.com/u/yannCI)\
**Post date:** [July 21, 2020, 11:41am UTC](https://discuss.circleci.com/t/how-do-i-know-why-a-build-is-unauthorized/36538/4 "2020-07-21T11:41:11Z")

</div>

@RangerRick, the context used in the workflow is restricted to `All Members` which means any member of the related GitHub organization.

Write permissions to a given repository don’t entail organization membership. So you would either need to add the user as a member of the OpenNMS GitHub organization or to enable the _ **Pass Secrets to Builds From Forked Pull Requests** _ option in the project settings.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/circleci/original/3X/5/1/511608acda8e85906e15909b57bd0a46c1dbe291.png) [@system](https://discuss.circleci.com/u/system)\
**Post date:** [July 31, 2020, 11:41am UTC](https://discuss.circleci.com/t/how-do-i-know-why-a-build-is-unauthorized/36538/5 "2020-07-31T11:41:13Z")

</div>

Closed on July 31, 2020, 11:41am UTC

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.
