mkalioby / django-passkeys

Django Authentication Backend For Passkeys
MIT License
197 stars 21 forks source link

Created Passkeys don't persist for login and username is not identified correctly. #22

Closed ndlaroy99 closed 10 months ago

ndlaroy99 commented 1 year ago

For reference, I am deploying my Django application using GCP Cloud Run based on an image I have hosted in the GCP Artifact Registry.

Every time I create a passkey (platform-agnostic, I've tried both on iOS and Windows), it only persists for a short while before the app appears to 'throw' the passkey away. If I were to click 'login with passkeys,' the credential combo is rejected. I can authenticate successfully with my username and password instead of the passkey and when I navigate to the 'My Passkeys' page after logging back in, it says 'You didn't have any keys yet.'

I believe there may be an issue with persisting the passkey within my application. The device that is creating the passkey has the right credential but the application is 'forgetting it' which is leading to failure to authenticate.

Thoughts?

mkalioby commented 1 year ago

How are you reaching your container and where is your database.. Please note that the key info is stored in db per user and if you recycle the db, all keys are rejected. Also you need a fixrd domain as changing domains will fail the request on authenticator.

ndlaroy99 commented 1 year ago

Here is the DNS config for the container and how it's mapped to my domain: image

The DB is static as the container version hasn't changed at all or been torn down and rebuilt

mkalioby commented 1 year ago

Can you share your FIDO_Server settings and login page url.

ndlaroy99 commented 1 year ago

Sure thing. See below. The URL of the website is nbc.northbrook-church.com.

image

mkalioby commented 1 year ago

Can you please sure a screenshot of your browser with login page.

ndlaroy99 commented 1 year ago

Screenshot 2023-08-02 at 9 26 43 AM

mkalioby commented 1 year ago

Connect to the database and check passkeys_userpasskey table content

ndlaroy99 commented 1 year ago

I cannot connect to the database as it is inside of the container that I am running which is only accessible on Port 8080. Perhaps I need to split out the database to its own container first.

mkalioby commented 1 year ago

You can register userpasskeys model in django admin if you like and check its content

ndlaroy99 commented 1 year ago

Great point. I’ll do that

mkalioby commented 1 year ago

Any update?

ndlaroy99 commented 1 year ago

I'm working on packaging the database into another container so that I can access it separately from the main app container. Sorry I haven't had much time to work on this the past week.

mkalioby commented 10 months ago

Closed due to inactivity