CLI command
skarbiec login identity
Name the account a login signs in as, so one account keeps one authenticator seed for every login of it: a Google account behind three logins needs one enrolment, not three. The account is named by the role its identity plays, never by an item id.
Invocation#
skarbiec login identity list [<login> | --accounts]
skarbiec login identity set <login> role:<role>
skarbiec login identity unset <login>
skarbiec login identity link --account <address> --role <role> [--yes]Purpose#
Name the account a login signs in as, so one account keeps one authenticator seed for every login of it: a Google account behind three logins needs one enrolment, not three. The account is named by the role its identity plays, never by an item id.
Required inputs and options#
- set takes the login and role:<role>, the role the identity plays (an item id is refused). link takes --account, the account's address, and --role, the role the identity plays or will play; without --yes it only shows what it would do. list takes a login, nothing (every login), or --accounts (every account the vault names, with what each lacks). POST /v1/operator/logins/identity/{set,unset,link} and GET /v1/operator/logins/identities take the same fields.
Output and state effects#
- set writes context.identity on the login and moves the login's working seed and second_factor record onto the identity, journalling login-identity-set; unset removes the name and journals login-identity-unset. link creates identity-<role> tagged stado:role:<role> when the account has none, names it on every live login of the account and moves the one shared seed onto it, journalling login-identity-linked. list --accounts prints each account with its identity, logins, seed state, verification and problems (lacks identity, logins with seeds that differ, logins that name another identity) with the command that fixes each.
Refusals#
- Every refusal is a declared cause of skarbiec.login-identity under /docs/errors. login-identity-not-login: the item is not a login. login-identity-not-identity: the role is played by another kind. login-identity-role-unheld: no live item plays the role. login-identity-account-unheld: the address names no login. login-identity-account-shared: two identities record the address. login-identity-role-elsewhere: the role is played by another account's identity or another kind. login-identity-seeds-differ: the logins keep different working seeds, so nothing is moved; keep the one the account accepts. login-identity-none-linked: no login of the account is left to link. login-identity-seed-stranded: the identity already keeps another seed.
- skarbiec.login-identity-list login-identity-not-login — exit 1: {doing} {id}; fix: name a login: skarbiec list --kind login lists them; skarbiec login identity list names the identity each one signs in as
- skarbiec.login-identity-set login-identity-not-login — exit 1: {doing} {id}; fix: name a login: skarbiec list --kind login lists them; skarbiec login identity list names the identity each one signs in as
- skarbiec.login-identity-set login-identity-not-identity — exit 1: {doing} {login}; fix: name the account's identity: skarbiec list --kind identity lists them, and skarbiec login identity link --account <address> --role <role> makes one for an account that has none
- skarbiec.login-identity-set login-identity-role-unheld — exit 1: {doing} {login}; fix: skarbiec login identity link --account <address> --role {role} makes the account's identity with that role, or skarbiec retag --add stado:role:{role} <identity-id> gives an existing one the role
- skarbiec.login-identity-set login-identity-account-unheld — exit 1: {doing} {login}; fix: skarbiec login identity link --account {account} --role <role> makes it and links every login of that account
- skarbiec.login-identity-set login-identity-account-shared — exit 1: {doing} {account}; fix: keep one: move the logins of the others with skarbiec login identity set <login> role:<role>, then skarbiec delete the others
- skarbiec.login-identity-set login-identity-seeds-differ — exit 1: {doing}; fix: find which seed the account accepts (skarbiec totp code <item> beside the code the account's authenticator shows), keep it on one item, empty the others with skarbiec field unset <item> totp_secret, and run it again
- skarbiec.login-identity-set login-identity-none-linked — exit 1: removing the identity {id} signs in as; fix: nothing to do; skarbiec login identity list {id} says what it signs in as
- skarbiec.login-identity-set login-identity-seed-stranded — exit 1: removing the identity {id} signs in as; fix: store the seed on {id} first (skarbiec totp uri {identity} | skarbiec totp set {id}), then remove the identity
- skarbiec.login-identity-link login-identity-account-shared — exit 1: {doing} {account}; fix: keep one: move the logins of the others with skarbiec login identity set <login> role:<role>, then skarbiec delete the others
- skarbiec.login-identity-link login-identity-role-elsewhere — exit 1: linking the logins of {account}; fix: name another role for {account}, or take the role off {holder}: skarbiec retag --remove stado:role:{role} {holder}
- skarbiec.login-identity-link login-identity-seeds-differ — exit 1: {doing}; fix: find which seed the account accepts (skarbiec totp code <item> beside the code the account's authenticator shows), keep it on one item, empty the others with skarbiec field unset <item> totp_secret, and run it again
- skarbiec.login-identity-link login-identity-providers-several — exit 1: linking the logins of {account}; fix: name the provider: skarbiec login identity link --account {account} --via <site> --role <role>