Giter Club home page Giter Club logo

Comments (9)

davidearl avatar davidearl commented on July 20, 2024

It looks like if the users directory is empty and you try to "log in" before registering, the example code gets this error. I'll fix this shortly by producing a more meaningful error message, but you would normally want to register before trying to "log in" - if there are no registrations, attempts to log in will inevitably fail.

from webauthn.

remivern avatar remivern commented on July 20, 2024

Thanks for your quick answer!

I have already tried using User Registration before. Sadly, the error message is couldn't initiate registration: SyntaxError: Unexpected token < in JSON at position 1

When i try to log in before regristering i have: couldn't initiate login: SyntaxError: Unexpected token < in JSON at position 1

I feel like I can not register :-(

from webauthn.

davidearl avatar davidearl commented on July 20, 2024

from webauthn.

davidearl avatar davidearl commented on July 20, 2024

Sorry, I didn't look closely enough at the error previously. So the problem is index.php is not in your document root, so when the Ajax callback happens it returns the default Apache server page rather than the JSON.

The example assumes this is on a dedicated (virtual) host so you should be able to find index.php in http://35.190.191.90/ along with the whole webauthn directory as checked out from github, and CBOREncode as checked out from github. Rather than copy webauthn/example/index.php up two levels, I suggest you link to it if your Apache setup allows links, or if not put an index.php in the top level which includes the one in example.

If http://35.190.191.90/ can't be dedicated to webauthn, you'll need to change the includes at the top of example, to be where you put the files, as $_SERVER['DOCUMENT_ROOT'] assumes it is at the top level.

So if, for example, you put it in "mywebauthn" and your document root is /var/www, then you'd have

   /var/www/mywebauthn
      index.php [link to index.php below]
      webauthn
             src
                   ...
             example
                    index.php
      CBOREncode
        ...

and change the four includes in index.php to add the mywebauthn directory after $_SERVER['DOCUMENT_ROOT'].'

I have checked that an install from scratch still works, and it does. I also just checked in a change to index.php to be clearer about where .users is if it can't be created, though this is not your initial problem.

from webauthn.

davidearl avatar davidearl commented on July 20, 2024

By the way, I know this is just as an example, but it is really rather pointless if you don't use https (you can get free certificates from LetsEncrypt), and you have left Indexes on on your Apache setup so all the files are readable externally including the .users directory. .users would ideally be elsewhere anyway. You certainly don't want a live version to do this!

from webauthn.

remivern avatar remivern commented on July 20, 2024

Hello!
Sorry, I really forgot to answer you. It's work fine !!!
I really enjoyed your help !!!

Rémi

from webauthn.

geraldkrug avatar geraldkrug commented on July 20, 2024

I got the webauthn result written into each fingerprint images exif copyright tag...
CopyrightNotice Copyright /a-finger/img/6865f27ef75723939f37d9da83cc6c55 The GDK Group

from webauthn.

davidearl avatar davidearl commented on July 20, 2024

Sorry @geraldkrug, I have no idea what you mean, and I don't see what it has to do with this issue. Please can you elucidate, in a new issue if that's what it is.

from webauthn.

davidearl avatar davidearl commented on July 20, 2024

Thank you @remivern . Closing this now.

from webauthn.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.