# TestFairy key with secret

**URL:** <https://discuss.bitrise.io/t/testfairy-key-with-secret/4644>\
**Category:** Issues\
**Tags:** step, ios\
**Created:** [March 28, 2018, 5:26pm UTC](https://discuss.bitrise.io/t/testfairy-key-with-secret/4644 "2018-03-28T17:26:05Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![ronan.o.ciosoig](https://avatars.discourse-cdn.com/v4/letter/r/a3d4f5/32.png) [@ronan.o.ciosoig](https://discuss.bitrise.io/u/ronan.o.ciosoig)\
**Post date:** [March 28, 2018, 5:26pm UTC](https://discuss.bitrise.io/t/testfairy-key-with-secret/4644/1 "2018-03-28T17:26:05Z")

</div>

We are using TestFairy for deployment to testers. In the workflow whenever we try to use a EnvVar or secret as the input to the step it fails with invalid API key. How should it be done?

We tested with both options enabled: replace variable inputs, expose to pull requests.

The main problem we have is that when someone uses the wrong key by mistake and we have to reset the key, it means we have to touch all the workflows for 35 projects.

---

<div class="post-metadata">

**Author:** ![viktorbenei](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/viktorbenei/32/18_2.png) [@viktorbenei](https://discuss.bitrise.io/u/viktorbenei)\
**Post date:** [March 29, 2018, 2:57pm UTC](https://discuss.bitrise.io/t/testfairy-key-with-secret/4644/2 "2018-03-29T14:57:47Z")

</div>

Hi @ronan.o.ciosoig,

> [@ronan.o.ciosoig](#):
>
> We are using TestFairy for deployment to testers. In the workflow whenever we try to use a EnvVar or secret as the input to the step it fails with invalid API key. How should it be done?

Can you please link a related build? It definitely should work, we’ll look into the build ASAP if you provide the url! 😉

---

<div class="post-metadata">

**Author:** ![ronan.o.ciosoig](https://avatars.discourse-cdn.com/v4/letter/r/a3d4f5/32.png) [@ronan.o.ciosoig](https://discuss.bitrise.io/u/ronan.o.ciosoig)\
**Post date:** [March 29, 2018, 6:49pm UTC](https://discuss.bitrise.io/t/testfairy-key-with-secret/4644/3 "2018-03-29T18:49:53Z")

</div>

> **[Bitrise - Mobile Continuous Integration and Delivery](https://app.bitrise.io/users/sign_in)**
>
> Mobile Continuous Integration and Delivery for your whole team, with dozens of integrations for your favourite services.

Here’s an example build that fails because of the API key.

---

<div class="post-metadata">

**Author:** ![viktorbenei](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/viktorbenei/32/18_2.png) [@viktorbenei](https://discuss.bitrise.io/u/viktorbenei)\
**Post date:** [March 30, 2018, 9:59am UTC](https://discuss.bitrise.io/t/testfairy-key-with-secret/4644/4 "2018-03-30T09:59:58Z")

</div>

> [@ronan.o.ciosoig](#):
>
> Here’s an example build that fails because of the API key.

You copied the build list page’s URL - can you please copy a specific build’s URL? Open the build’s page and copy the url from there 🙂

---

<div class="post-metadata">

**Author:** ![ronan.o.ciosoig](https://avatars.discourse-cdn.com/v4/letter/r/a3d4f5/32.png) [@ronan.o.ciosoig](https://discuss.bitrise.io/u/ronan.o.ciosoig)\
**Post date:** [April 3, 2018, 2:55pm UTC](https://discuss.bitrise.io/t/testfairy-key-with-secret/4644/5 "2018-04-03T14:55:18Z")

</div>

[https://www.bitrise.io/build/6fd2c9560538da2d](https://www.bitrise.io/build/6fd2c9560538da2d) This is it.

---

<div class="post-metadata">

**Author:** ![viktorbenei](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/viktorbenei/32/18_2.png) [@viktorbenei](https://discuss.bitrise.io/u/viktorbenei)\
**Post date:** [April 5, 2018, 3:46pm UTC](https://discuss.bitrise.io/t/testfairy-key-with-secret/4644/6 "2018-04-05T15:46:23Z")

</div>

Checked the build, did not see any issue with the config. So far it seems that the API Key you specified might be the issue.

Are you sure that you used the right one? Should be an alpha-numerical one like: `c2f3972...9635e` (40 chars long, unless they changed this in the last year).

---

<div class="post-metadata">

**Author:** ![ronan.o.ciosoig](https://avatars.discourse-cdn.com/v4/letter/r/a3d4f5/32.png) [@ronan.o.ciosoig](https://discuss.bitrise.io/u/ronan.o.ciosoig)\
**Post date:** [April 5, 2018, 9:35pm UTC](https://discuss.bitrise.io/t/testfairy-key-with-secret/4644/7 "2018-04-05T21:35:27Z")

</div>

I am absolutely sure about the key. If I put the key in directly in the field for TF, it works fine. If I use an environment variable it always fails with an invalid key error. We have since had an issue that this key way invalidated and we are using a new one now so that can break the testing.

---

<div class="post-metadata">

**Author:** ![ronan.o.ciosoig](https://avatars.discourse-cdn.com/v4/letter/r/a3d4f5/32.png) [@ronan.o.ciosoig](https://discuss.bitrise.io/u/ronan.o.ciosoig)\
**Post date:** [April 5, 2018, 10:10pm UTC](https://discuss.bitrise.io/t/testfairy-key-with-secret/4644/8 "2018-04-05T22:10:10Z")

</div>

Here is a build that fails with invalid key: [https://www.bitrise.io/build/fc62225b93cd329a](https://www.bitrise.io/build/fc62225b93cd329a)  
and the same branch but with a changed key that passes. [https://www.bitrise.io/build/0f1b0fde75e62fb6](https://www.bitrise.io/build/0f1b0fde75e62fb6)

The Beta\_with\_key workflow has one change made from Beta - it uses the key directly in the TestFairy upload step instead of used the secret. This clearly illustrates that there seems to be a problem with the step.

@viktorbenei

---

<div class="post-metadata">

**Author:** ![ronan.o.ciosoig](https://avatars.discourse-cdn.com/v4/letter/r/a3d4f5/32.png) [@ronan.o.ciosoig](https://discuss.bitrise.io/u/ronan.o.ciosoig)\
**Post date:** [April 10, 2018, 8:46am UTC](https://discuss.bitrise.io/t/testfairy-key-with-secret/4644/9 "2018-04-10T08:46:17Z")

</div>

Hi @viktorbenei this issue still open.

---

<div class="post-metadata">

**Author:** ![viktorbenei](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/viktorbenei/32/18_2.png) [@viktorbenei](https://discuss.bitrise.io/u/viktorbenei)\
**Post date:** [April 13, 2018, 3:16pm UTC](https://discuss.bitrise.io/t/testfairy-key-with-secret/4644/10 "2018-04-13T15:16:14Z")

</div>

Ahh, thanks for the link, I found the issue now after comparing the configs.

The issue is that you specified the `is_expand: true` flag at the wrong level, on the step level not on an input level. This is a per-input option and can only be specified there, if you specify it on step level it won’t change the expand options of the inputs.

So, instead of:

```auto
    - testfairy-deploy@2.0.1:
        is_expand: true
        inputs:
        - auto_update: 'on'
        - api_key: "$TEST_FAIRY_API_KEY"
        - comment: Beta version of the app

```

Please use:

```auto
    - testfairy-deploy@2.0.1:
        inputs:
        - auto_update: 'on'
        - api_key: "$TEST_FAIRY_API_KEY"
          opts:
            is_expand: true
        - comment: Beta version of the app

```

You can see on the UI whether the expand option is enabled for a given input, right under the input’s value. With your original config:

 ![Screen_Shot_2018-04-13_at_17_12_55](https://us1.discourse-cdn.com/flex016/uploads/bitrise/original/2X/3/3a91a0fd92ca323043d58d86cc92dcc88a7b536f.png)

with my modified config:

 ![Screen_Shot_2018-04-13_at_17_12_07](https://us1.discourse-cdn.com/flex016/uploads/bitrise/original/2X/b/bb75cd6b7a52fdf73441767742e7b4ec687a3e6d.png)

Let me know if this wouldn’t help or if you’d have any questions! 😉

---

<div class="post-metadata">

**Author:** ![ronan.o.ciosoig](https://avatars.discourse-cdn.com/v4/letter/r/a3d4f5/32.png) [@ronan.o.ciosoig](https://discuss.bitrise.io/u/ronan.o.ciosoig)\
**Post date:** [April 15, 2018, 8:29pm UTC](https://discuss.bitrise.io/t/testfairy-key-with-secret/4644/11 "2018-04-15T20:29:39Z")

</div>

I suspected it was an issue with that flag but didn’t know the correct place to put it. Thanks.

---

<div class="post-metadata">

**Author:** ![viktorbenei](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/viktorbenei/32/18_2.png) [@viktorbenei](https://discuss.bitrise.io/u/viktorbenei)\
**Post date:** [April 19, 2018, 3:04pm UTC](https://discuss.bitrise.io/t/testfairy-key-with-secret/4644/12 "2018-04-19T15:04:39Z")

</div>

Any time 😉

---

<div class="post-metadata">

**Author:** ![viktorbenei](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/viktorbenei/32/18_2.png) [@viktorbenei](https://discuss.bitrise.io/u/viktorbenei)\
**Post date:** [May 3, 2018, 4:00pm UTC](https://discuss.bitrise.io/t/testfairy-key-with-secret/4644/13 "2018-05-03T16:00:35Z")

</div>

Closed on May 3, 2018, 4:00pm UTC

This topic was automatically closed after 14 days. New replies are no longer allowed.
