Follow the instructions in the Try Out the Sample Apps section to register an application.
Make sure to add https://localhost:3000
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
baseUrl: "<ADD_BASE_URL_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:3000
. If the browser doesn't open the app and throws an invalid-certificate error, just type thisisunsafe
to continue.
By default, the development server runs on port 3000
. Incase if you wish to change this to something else, follow the steps below.
- Update the
PORT
in .env file in the app root. - Update the
signInRedirectURL
&signOutRedirectURL
inauthConfig
object in index.html. - Go to the Asgardeo Console and navigate to the protocol tab of your application:
- Update the Authorized Redirect URL.
- Update the Allowed Origins.
Licenses this source under the Apache License, Version 2.0 (LICENSE), You may not use this file except in compliance with the License.