What's the best way to minimize 2fa queries for snapcraft ?

Bug #1564864 reported by Vincent Ladeuil
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical SSO provider
Invalid
Undecided
Unassigned

Bug Description

Working on 'snapcraft login' I ran into the following issue:

- login to SSO with 2FA (as that's the default mode for snapcraft),

- get the root macaroon from sca

- get the discharge_macarron from sso
=> fails with ssoclient.v2.errors.TwoFactorRequired: 401: TWOFACTOR_REQUIRED

- get the discharge macaroon from sso with the otp used for login
=> fails with
ssoclient.v2.errors.TwoFactorFailure: 403: TWOFACTOR_FAILURE

- get the discharge macaroon with an auth based on the login session and the
  login otp

=> fails with ssoclient.v2.errors.TwoFactorRequired: 401: TWOFACTOR_REQUIRED

- get the discharge macaroon from sso with a *new* otp without auth
=> works

So I'm not sure I'm using the API correctly but if getting a discharge
macaroon /always/ require 2fA for any operation (discharge macaroons
refreshes have been mentioned recently), the user experience will
be... painful :-/

Advice welcome.

Revision history for this message
Vincent Ladeuil (vila) wrote :

Ideally I should be able to get a discharge macaroon while being auth'ed with the first otp and without having to use a second one.

summary: - discharge macaroon should be provided by sca or 2fa makes like miserable
+ requiting 2 one-time-passwords to get a discharge macaroon makes like
+ miserable
Evan (ev)
summary: - requiting 2 one-time-passwords to get a discharge macaroon makes like
+ requiting 2 one-time-passwords to get a discharge macaroon makes life
miserable
Vincent Ladeuil (vila)
summary: - requiting 2 one-time-passwords to get a discharge macaroon makes life
- miserable
+ What's the best way to minimize 2fa queries for snapcraft ?
Revision history for this message
Vincent Ladeuil (vila) wrote :

Thanks to Facundo for clarifying, the bit I missed was that a discharge macaroon can be refreshed without requiring a new 2FA otp (as long the the user is still valid, didn't change his password, etc).

Changed in canonical-identity-provider:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.