No error id for username/password error returned from snapd

Bug #1598657 reported by Robert Ancell
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snappy
Fix Released
Undecided
John Lenton
gnome-software (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

If you fail to authentication with snapd the response is:

{"type":"error","status-code":401,"status":"Unauthorized","result":{"message":"cannot get discharge macaroon from store: Provided email/password is not correct."}}

In comparison, if you provide valid credentials but need two factor you get the response:

{"type":"error","status-code":401,"status":"Unauthorized","result":{"message":"two factor authentication required","kind":"two-factor-required"}}

The latter response has a 'kind' field which a client can use to provide appropriate text / imagery to inform the user. The former response does not, and the message is inappropriately technical to show to a user.

Revision history for this message
Robert Ancell (robert-ancell) wrote :

Suggest solution - add a kind="email-password-incorrect" field.

description: updated
Revision history for this message
John Lenton (chipaca) wrote :

In #1562 I'm returning a 400 with `invalid-auth-data` when e.g. the email provided is not valid (the value will describe the validation error in detail); a 401 with `login-required` will be returned by other unauthorised results (e.g. provided email/password is not correct.).

John Lenton (chipaca)
Changed in snappy:
assignee: nobody → John Lenton (chipaca)
status: New → Fix Committed
Revision history for this message
Robert Ancell (robert-ancell) wrote :

Fixed in snapd 2.12

Changed in gnome-software (Ubuntu):
status: New → Fix Released
importance: Undecided → Medium
Changed in snappy:
status: Fix Committed → Fix Released
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.