daliborgogic / nemid

Experimental Node.js Danish NemId integration for authenticating a user.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot get it working

mbalslow opened this issue · comments

Hi @daliborgogic,

Cool repo! Looking to test setting up NEMid auth for a Node.js app with Vue, and your repo seems like a good starting point. However, I am not able to get it up and running.

These are the steps I have taken:

  • Download the source code
  • Run "npm i"
  • In the "api" dir, created a new folder called "certs"
  • Downloaded the valid certificate "DanID Test (gyldig)" ("VOCES_gyldig_2022.p12")
  • Run "."C:\Program Files\OpenSSL-Win64\bin\openssl.exe" pkcs12 -in api/certs/VOCES_gyldig_2022.p12 -out api/certs/public.pem -clcerts -nokeys"
  • Run "."C:\Program Files\OpenSSL-Win64\bin\openssl.exe" pkcs12 -in api/certs/VOCES_gyldig_2022.p12 -out api/certs/private.pem -clcerts"
    • With some password
  • Set my environment variables
  • Run "npm run dev" works and the site is "working" but it fails after a succesful login with one of the test users:
    image

From what I can see in the code, it seems that the "app.get('/nets/spid')" endpoint is a "GET" endpoint, however, the frontend is performing a "POST" request. I do not understand how this could ever work? Also, that same endpoint seems to never use the request body containing the information about the login.

Any help would be appreciated and am I happy to contribute with a bit on guidance/direction.

Thanks.