5

So When i use the below in .travis.yml it works ..

*********************
    deploy:
      user: mybintrayuserid
      provider: bintray
      file: .bintray_descriptor.yml
      key: myapikey

***********************

but if i change this to below i get error:

**************************
deploy:
  user: mybintrayuserid
  provider: bintray
  file: .bintray_descriptor.yml
  key:
    secure: encryptedHashHash
****************************

Error that i get :

[Bintray Upload] Bintray response: 401 Unauthorized. This resource requires authentication .

How i generated the key :

travis encrypt myapikey --add deploy.key

Note: I've added screenshot too for more details ..

Screenshot : https://i.stack.imgur.com/rhkgJ.png

Dhyan
  • 551
  • 2
  • 6
  • 15

2 Answers2

3

Make sure you use the correct user also.

In my case, I was trying to deploy to a repo owned by an organization, and I wrongly configured the user as the organization name.

Instead of using the organization as the user in your .travis.yml you must use your the username associated with the API key.

I have both the user and the key encrypted - and working.

Reinaldo Junior
  • 2,387
  • 1
  • 15
  • 15
  • as mentioned aboeve i did use my user id and not organization name – Dhyan Oct 28 '15 at 04:21
  • @Dhyan, i think this answer is correct. In my case a user name and a repository name have matter. But i should add that i am talking not about a user name you add to key 'user:'. I am talking about group 'user/repo' you used for generation a secured key. – dismine Dec 15 '16 at 13:29
1

FWIW, the same thing happens to me. I assume it's a failure with the Bintray plug-in as the notion of a secure token isn't native to the Bintray API but part of the Travis integration provided by Travis.

akutz
  • 355
  • 4
  • 5