oktadev / okta-angular-pwa-example

A Progressive Web Application example using Angular 7

Home Page:https://developer.okta.com/blog/2019/01/30/first-angular-pwa

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Angular 7 PWA Example

This example shows how to build a search app with Angular, Angular CLI, and Angular Material.

Please read Build Your First PWA with Angular to see how this app was created.

Prerequisites: Node.js.

Okta has Authentication and User Management APIs that reduce development time with instant-on, scalable user infrastructure. Okta's intuitive API and expert support make it easy for developers to authenticate, manage and secure users and roles in any application.

Getting Started

To install this example application, run the following commands:

git clone https://github.com/oktadeveloper/okta-angular-pwa-example.git
cd okta-angular-pwa-example

This will get a copy of the project installed locally. To install all of its dependencies and start each app, follow the instructions below.

Run the app using:

npm install
npm start

Create a New OIDC App in Okta

Before you begin, you’ll need a free Okta developer account. Install the Okta CLI and run okta register to sign up for a new account. If you already have an account, run okta login. Then, run okta apps create. Select the default app name, or change it as you see fit. Choose Single-Page App and press Enter.

Use http://localhost:4200/callback for the Redirect URI and set the Logout Redirect URI to http://localhost:4200.

Copy your issuer and copy the clientId in to src/app/app.module.ts.

const oktaConfig = {
  issuer: 'https://{yourOktaDomain}/oauth2/default',
  clientId: '{clientId}',
  redirectUri: window.location.origin + '/callback'
};

Links

This example uses the following open source libraries from Okta:

Help

Please post any questions as comments on the blog post, or visit our Okta Developer Forums.

License

Apache 2.0, see LICENSE.

About

A Progressive Web Application example using Angular 7

https://developer.okta.com/blog/2019/01/30/first-angular-pwa


Languages

Language:TypeScript 71.7%Language:HTML 16.4%Language:JavaScript 9.9%Language:CSS 1.9%