Testing facebook sign-in for a web app.
- NodeJS
- node version 12.16.3
- npm version 6.14.4
- Windows OS 64 bit (optional)
-
Clone this repository.
git clone https://github.com/weaponsforge/facebook-app.git
-
Install dependencies.
npm install
-
Run the local web server.
npm run start
-
Launch the app on a web browser.
https://localhost:3000
WARNING: Loading https://localhost:3000 as ease will load the web app on an insecure ssl connection. Test signing in to FB at your own risk.
If you want load the web app on a secure connection from localhost, follow the instructions discussed in the section Use Secure SSL Certificates on Localhost. (for windows OS only instructions for other OS may vary)
-
Launch notepad with Administrator access and open the
C:\Windows\System32\drivers\etc\hosts
file. -
Append the following lines:
127.0.0.1 mywebsite.com 127.0.0.1 localhost
-
Press Search from windows menu and search for certmgr.msc.
-
Under the certmgr window,
- Go to Certificates - Current User -> Trusted Root Certification Authority -> Certificates
- Right + Click the Certificates directory
- Select All tasks -> Import
- Browse for the localhost-ssl.cer file under
/server/helpers/localhost-ssl.cer
- Press the Next button.
- Select the option
Place all certificates in the following store
- Certificate store: Trusted Root Certification Authorities
- Press the Next button, then Finish
- A Security Warning window will appear. Press the Yes button.
- Browse for the localhost-ssl.cer file under
-
Close all instances of the Chrome browser, and re-open again. Load your localhost project:
https://localhost:3000
. This should now display a secure SSL connection. -
After you are done testing, it is a good idea to revert all changes made on steps #2 and #4 to prevent security holes in your Windows system.
@weaponsforge
20200609