ngrok makes local web applications reachable over the internet with a single command. The following steps show the setup and usage of ngrok for testing your Corbado setup locally with multiple devices.
This guide assumes that you’ve set up your account in the Corbado developer
panel. If you haven’t done so, please check Getting
Started.
Testing your local setup with ngrok allows Corbado to communicate with your local system, e.g. to access the application from different devices. In production or staging mode, systems are often accessible over the Internet anyways but for local developing and testing, ngrok saves a ton of work.
For this guide, we assume you are using a Node.js app. If you are using a different framework / programming language, just change the run commands to start your (backend) application.
2.2 Launch ngrok to connect it to your application
The ngrok http <port> command starts the ngrok tunnel on the specified port. Our application runs on port 8080, so we’ll execute
Copy
Ask AI
ngrok http 8080
The terminal will display something like the following:Copy the ngrok URL in the red box which is needed for the Corbado developer panel.
Please open the ngrok URL in the browser before proceeding and confirm the usage.Please use the ngrok URL as testing URL (instead of localhost) in your browser!
As passkeys / WebAuthn are phishing-resistant and passkeys are bound to a domain during creation (Relying Party ID), you need to make sure that the browser URL is the same domain or a subdomain of the Relying Party ID. Thus, you need to update the Relying Party ID for ngrok as well:
Note that all passkeys created for the existing Relying Party ID (e.g.
“localhost”) are not working anymore, as well as creating passkeys from the
old domain doesn’t work anymore as well.