withfig / fig

Public issue tracker for Fig.
https://fig.io
MIT License
2.05k stars 63 forks source link

fig login for headless install: alternative login options #2286

Open nick-youngblut opened 1 year ago

nick-youngblut commented 1 year ago

Sanity checks

Feature Details

Description:

At for Fig 2.13.1, the only login option for a headless install is fig login, followed by authentication via email. I would be great if one could authenticate by providing credentials directly within fig login (e.g., fig login --username XXX --credentials XXX). Then, one could use 1password cli, GitHub Secrets, or something similar to automatically login to fig upon the creation of a devcontainer (or similar dev env setup).

grant0417 commented 1 year ago

This is in the works, the plan is to add an environment variable FIG_TOKEN which you can set here if you are using codespaces that will auth you by default

mvgijssel commented 1 year ago

Yes this would be perfect for our devcontainer developer environments at HackerOne, being able to login with a token!

nick-youngblut commented 1 year ago

I see that fig login now allows for --token (using fig 2.14.2), but I can't figure out how to create the user token. @grant0417 can you please explain how to create the token?

grant0417 commented 1 year ago

You can create a token by running fig user token new <token-name> somewhere where you are already logged in, you will get a token that should look like figapi_xxxxxxxxx which you can then use with fig login --token fig_api_xxxxxxxx to auth another machine.

Note the <token-name> is just a description of the token but is required.

grant0417 commented 1 year ago

There is now a page you can go to that you can generate tokens with and see all of your tokens, https://app.fig.io/settings/user-tokens