I have created SNAPCRAFT_STORE_CREDENTIALS variable using content from ‘snapcraft export-login file’ command.
But snapcraft login doesn’t work. Could someone help me with this? Output:
Cannot login with 'SNAPCRAFT_STORE_CREDENTIALS' set.
Recommended resolution: Unset 'SNAPCRAFT_STORE_CREDENTIALS' and try again.
Full execution log: '/home/.../.local/state/snapcraft/log/snapcraft-20240624-152008.504598.log'
The SNAPCRAFT_STORE_CREDENTIALS variable is used instead of logging in, e.g:
# Make the credentials available to the shell
export SNAPCRAFT_STORE_CREDENTIALS="$(cat credential-file)"
# execute a command which requires you to be logged in,
# or a credential to be specified
snapcraft names
I used export-login some months ago to generate the macaroon that @mr_cal described. I moved it into a container where I have a tool which uses the macaroon to gather metrics. Whilst I do not have access to the command I executed, I am reasonably certain it was this:
See here for a list of ACLs. (Aside: I think it would be helpful to include these in the CLI documentation, maybe I’ll investigate that in the near future).
If you did this, you could proceed to use the credential:
If you export to SNAPCRAFT_STORE_CREDENTIALS long back, then you can run snapcraft whoami and see if the credentials are expired!! If the credentials are expired then set them again.
It also shows what all permissions are allowed as well!!