Download the sample Angular application
To view a simple example of an Angular application, clone the Okta Angular Identity Engine sample app and follow the set up procedure:
Clone the Angular sample repository
Clone the Okta Angular sample app repository and navigate to the top-level folder.
Install the dependencies
Install the dependencies in the okta-angular-oie-sample-quickstart
folder:
Update the application configuration file
Update the Okta sample application configuration file (src/app/okta-config.ts
) in the project root folder. The okta-config.ts
file contains the configuration values for your Okta app integration. See Create an app integration for details on these values.
Run the sample application
Navigate to the project folder and run the sample application.
Open a new browser and navigate to the default local host port (http://localhost:4200
). Click Login and sign in with a user from your Okta org. After a successful authentication, the user's ID token appears on the page.
Create a new Angular app (optional)
To create an Angular app, open a terminal and install the Angular CLI:
Now, create a new application using the Angular CLI:
When asked Would you like to add Angular routing?
, press y.
After all prompts are answered, the Angular CLI creates a new project in a folder named okta-app
and installs all required dependencies.
Install the Okta Auth SDK (opens new window) using npm
: