HTML Javascript Sample Application using Asgardeo's Auth SPA SDK
Follow the instructions in the Try Out the Sample Apps section to register an application.
Make sure to add https://localhost:5000
as a Redirect URL and also add it under allowed origins.
- Update the
authConfig
object inindex.html
with your registered app details.
Note: You will only have to paste in the client ID
generated for the application you registered.
Read more about the SDK configurations here .
const authConfig = {
// ClientID generated for the application
clientID: "<ADD_CLIENT_ID_HERE>",
// After login callback URL - We have to use the app root as this is a SPA
// (Add it in application OIDC settings "Callback Url")
signInRedirectURL: origin,
// Asgardeo URL
serverOrigin: "<ADD_SERVER_ORIGIN_HERE>",
};
Note: If you are deploying and testing out this sample in your own server environment, just adding the static files would be enough. The following steps demonstrates the usage of a 3rd party module to serve up the static content.
The sample is using http-server package to serve the static files. You have to install it through npm.
npm install
npm start
The app should open at https://localhost:5000
. If the browser doesn't open the app and throws an invalid-certificate error, just type thisisunsafe
to continue.