How to generate token from API

144 views
Skip to first unread message

James Regis

unread,
Oct 7, 2022, 3:30:03 PM10/7/22
to quay-sig
Hello,

Since a few days I'm looking for a way to generate a token via API because I'd like to automate the creation of organizations and repositories with Ansible. Could one of you tell me how to do it?

Thanks

James

Daniel Messer

unread,
Oct 10, 2022, 4:08:58 AM10/10/22
to James Regis, quay-sig
Hi James,

tokens are essentially API keys, so by this nature you cannot create them via the API as part of a script. This is similar to GitHub Personal Access Tokens (PATs): you use the UI to create these Application Tokens according to the scope you need them. If this is part of a deployment automation in a greenfield environment, where Quay does not exist yet, you can use the Quay configuration file and the API when you deploy a fresh Quay instance.

HTH,
Daniel

--
You received this message because you are subscribed to the Google Groups "quay-sig" group.
To unsubscribe from this group and stop receiving emails from it, send an email to quay-sig+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/quay-sig/e5a3871d-8ffd-4238-a49b-b21fa482737an%40googlegroups.com.


--
Daniel Messer

Product Manager Operator Framework & Quay

Red Hat OpenShift

James Regis

unread,
Oct 11, 2022, 2:00:19 PM10/11/22
to Daniel Messer, quay-sig
Hi Daniel, 

That's what I thought too. Thanks for your answer.

Can you tell me what is the best (recommended) way to proceed ?

First install Quay and as quayadmin (first admin user) create a token with Administrative User right and use that one to create Orgs, Repos, Robots, etc ... ? or is there another way to do it ?

Regards,

James
--
James

Daniel Messer

unread,
Oct 12, 2022, 4:32:50 AM10/12/22
to James Regis, quay-sig
Hi James,

in our documentation we have described a way how you can use the API to get the first initial user setup and an API token as part of that operation. It only works with a vanilla / fresh Quay deployment. If that user is configured with superuser privileges it can work as you described.


Best,
Daniel

James Regis

unread,
Jan 19, 2023, 9:39:56 AM1/19/23
to quay-sig
Thank you Daniel !
Reply all
Reply to author
Forward
0 new messages