Add Authentication to Your Vanilla JavaScript App in 20 Minutes

Add Authentication to Your Vanilla JavaScript App in 20 Minutes

This shows how to create an app with plain ol’ vanilla JavaScript and add authentication to it to secure its communication with a REST API.

Rafael Hernandez

Thank you for the great tutorial. I hope to be able to integrate the Okta sign-in widget into a future project.

https://media2.giphy.com/me…

Sayed KB- Knowledge Solutions

Thanks for the article. However, I am getting following error on the page :

We found some errors. Please review the form and make corrections.

My Network connections look ok :

Request URL: https://accenturedev7mn.okt…
Request Method: OPTIONS
Status Code: 200
Remote Address: 34.236.241.38:443
Referrer Policy: no-referrer-when-downgrade

Matt Raible

I’m not sure how to solve your problem. You haven’t provided enough information. Can you please check your browser’s developer console and see if there are more errors in there? I’m guessing you might have a CORS issue and you need to add your app’s URL in API > Trusted Origins.