Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ability to authenticate with renewed username #504

Closed
markmhendrickson opened this issue Jul 11, 2020 · 26 comments · Fixed by #2333
Closed

Fix ability to authenticate with renewed username #504

markmhendrickson opened this issue Jul 11, 2020 · 26 comments · Fixed by #2333
Assignees
Labels
bug Functionality broken bug-p2 Critical functionality broken for few users, with no clear workarounds effort:large Expected to take over 1 week of integration work

Comments

@markmhendrickson
Copy link
Collaborator

markmhendrickson commented Jul 11, 2020

My username markmhendrickson.id expired but remained listed in the "Choose username" modal during authentication. Having since re-purchased it, I'm unable to authenticate with any apps (e.g. https://app.sigle.io/, http://humans.name/).

The selection interaction for this username works in the popup, but then I see an error in the app's console after the popup closes automatically.

Screen Shot 2020-07-11 at 20 54 23

Screen Shot 2020-07-11 at 20 54 49

@markmhendrickson markmhendrickson added the bug Functionality broken label Jul 11, 2020
@markmhendrickson markmhendrickson added this to the 2020 W29-W31 milestone Jul 15, 2020
@markmhendrickson markmhendrickson removed this from the 2020 W29-W31 milestone Aug 12, 2020
@hstove hstove added enhancement-p3 Non-critical functionality wanted by many users, or there are clear alternatives effort:large Expected to take over 1 week of integration work labels Aug 12, 2020
@stale
Copy link

stale bot commented Feb 9, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Feb 9, 2021
@stale
Copy link

stale bot commented Feb 16, 2021

This issue has been automatically closed. Please reopen if needed.

@stale stale bot closed this as completed Feb 16, 2021
@stale stale bot removed the stale label Feb 16, 2021
@markmhendrickson markmhendrickson added the bug-p2 Critical functionality broken for few users, with no clear workarounds label Feb 16, 2021
@markmhendrickson
Copy link
Collaborator Author

This issue may become particularly relevant again soon since usernames are set to expire en masse after their 1-year extension upon the launch of Stacks 2.0. Those who renew their usernames in time may find themselves subsequently unable to authenticate.

@markmhendrickson markmhendrickson changed the title Fix ability to authenticate with re-purchased username Fix ability to authenticate with renewed username Mar 4, 2022
@fbwoolf
Copy link
Contributor

fbwoolf commented Mar 9, 2022

@markmhx when I look at your username, the expire block is 52595 and the current block is 51673, so why do you think your username is expired? https://stacks-node-api.mainnet.stacks.co/v1/names/markmhendrickson.id

@fbwoolf
Copy link
Contributor

fbwoolf commented Mar 9, 2022

I can't reproduce this with the secret key @kyranjamie gave me bc his is the same: https://stacks-node-api.mainnet.stacks.co/v1/names/kyranjamie.id

@fbwoolf
Copy link
Contributor

fbwoolf commented Mar 10, 2022

@fbwoolf
Copy link
Contributor

fbwoolf commented Mar 10, 2022

I feel like I am seeing a different welcome screen than shown in the issue description for Sigle:
Screen Shot 2022-03-09 at 7 39 58 PM

@markmhendrickson
Copy link
Collaborator Author

@janniks could you possibly help determine and execute the fix here on the Stacks.js side?

@markmhendrickson markmhendrickson removed their assignment Mar 17, 2022
@janniks
Copy link
Contributor

janniks commented Mar 17, 2022

Yes, I can look into this.

Do we have testnet id's (or something similar) for an expired and a valid id, for reproducing?

@markmhendrickson
Copy link
Collaborator Author

Good question. @Eshwari007 @timstackblock do you have any such usernames in your arsenal?

@Eshwari007
Copy link

Good question. @Eshwari007 @timstackblock do you have any such usernames in your arsenal?

@markmhx @janniks We do have a couple of IDs in our test account. Not sure if they were from v1 though.
Screen Shot 2022-03-17 at 9 55 24 AM

@markmhendrickson
Copy link
Collaborator Author

Those usernames appear to be registered on Stacks 2.0 and therefore haven't expired yet.

@janniks it may be easiest if we meet via Zoom with screen share since I have an expired username in my personal wallet?

@larrysalibra
Copy link

I spent a bit more time digging into this today. I'm using the name "newinternetlabs.id" which was both renewed and transferred to the wallet address (aka upgraded). I haven't been able to sign in with it using Stacks connect since i transferred it to the wallet address.

Signing in with stacks todos sample app gives me a bit more information than in an app using Stacks Connect.

It says that that there was an error checking doPublicKeysMatchUsername.

In this function, we look at the issuer address from the authentication token and compare it to the address that owns the name.

Unfortunately, I can't figure out how to print out the token to console so that I can inspect its contents. Prior to stacks connect, this was passed in the address bar URL, but another method seems to be used. Happy to take a look if someone can point me in the right direction.

It looks like it is making a call to this endpoint and failing: https://registrar.stacks.co/v1/names/markhendrickson.id

With regards to that error, I don't think that is the root of this problem. The function that verifies the username owner has several look up addresses and if any one of them succeeds, then the authentication will succeed. From what I've seen, this url: https://registrar.stacks.co/v1/names/ fails even on successful authentications because that url doesn't actually look up names. Perhaps it should be removed as a fallback url?

Screen Shot 2022-03-22 at 20 57 10

@markmhendrickson
Copy link
Collaborator Author

@janniks has prepared this build that removes all logic for checking usernames from the authentication process: https://www.dropbox.com/s/zpjwoddge0soy13/stacks-wallet-chromium.zip?dl=0

It can be used to test whether this issue is resolved, and whether there are any undesired side effects to doing so.

@larrysalibra our suspicion here is that it's not necessary to block authentication with such checks in general, and it's most expeditious to just get rid of them if they're causing issues with renewed and expired names. Do you recall why these lookups were integrated into blockstack.js in the first place?

@MountainMaster
Copy link

The DEV-Version (3.3.0?) did not work for me.
On btc.us it does not login without any response and on arkadiko I get the following error

code: "login_failed"
message: "Failed to login: Invalid authentication response."
name: "LoginFailedError"

image

@markmhendrickson
Copy link
Collaborator Author

markmhendrickson commented Mar 23, 2022

I'm getting the same – note the "doPublicKeysMatchUsername" error checking message

image

image

@markmhendrickson
Copy link
Collaborator Author

@janniks do you expect this issue to be resolved fully app-side with hirosystems/stacks.js#1230?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Functionality broken bug-p2 Critical functionality broken for few users, with no clear workarounds effort:large Expected to take over 1 week of integration work
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants