Skip to content

oktadev/okta-vue-books-pwa-example

Repository files navigation

Vue + TypeScript => PWA 💚💙

This example app shows how to build a PWA with Vue and TypeScript.

Please read Build Your First PWA with Vue and TypeScript 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-vue-books-pwa-example.git
cd okta-vue-books-pwa-example

This will get a copy of the project installed locally. To install all of its dependencies, run:

npm install

Create a New OIDC App in Okta

If you don't have an Okta developer account, please create one. Then, create a new OIDC app on Okta:

  1. Log in to your developer account, navigate to Applications > Add Application.
  2. Select Single-Page App > Next.
  3. Give the application a name and set the redirect uri to: http://localhost:8080/callback.
  4. click Done.

Set the issuer and copy the clientId into src/router/index.ts.

Vue.use(Auth, {
  issuer: 'https://{yourOktaDomain}/oauth2/default',
  client_id: '{clientId}',
  redirect_uri: window.location.origin + '/callback',
});

Run the app with:

vue serve

And log in at http://localhost:8080.

Links

This example uses the following open source libraries from Okta:

Help

Please post any questions as commnets on the blog post or ask them on the Okta Developer Forums. Our whole team monitors this channel and will see your questions. You can also enter them as issues on this project or ask them on Stack Overflow and add the okta tag.

License

Apache 2.0, see LICENSE.