GithubHelp home page GithubHelp logo

isabella232 / okta-secure-vue-aws-client-example Goto Github PK

View Code? Open in Web Editor NEW

This project forked from oktadev/okta-secure-vue-aws-client-example

0.0 0.0 0.0 210 KB

A Secure Vue.js App, Deployed to AWS

Home Page: https://developer.okta.com/blog/2018/07/03/deploy-vue-app-aws

License: Apache License 2.0

JavaScript 86.15% HTML 0.92% Vue 12.93%

okta-secure-vue-aws-client-example's Introduction

A Secure Vue.js App, Deployed to AWS

This example app shows how to build a Vue.js app, deploy it to AWS, add CloudFront as a CDN, and deploy an Express API to AWS Lambda.

Please read Deploy Your Secure Vue.js App to AWS 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-secure-vue-aws-client-example.git vue-aws-client
cd vue-aws-client

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

npm install
npm run dev

You will also need to get the server example app if you want to verify API communication works.

git clone https://github.com/oktadeveloper/okta-secure-vue-aws-server-example.git vue-aws-server
cd vue-aws-server
npm install

Setup Okta

To use Okta, you'll need to change a few things. First, you'll need to create a free developer account at https://developer.okta.com/signup/. After doing so, you'll get your own Okta domain, that has a name like https://dev-123456.oktapreview.com.

Create an OIDC App in Okta to get a {clientId} and {clientSecret}. To do this, log in to your Okta Developer account and navigate to Applications > Add Application. Click Single-Page App and click the Next button. Give the app a name you’ll remember, specify http://localhost:8080 as a Base URI, and http://localhost:8080/implicit/callback as a Login Redirect URI. Click Done and copy the client ID and secret into the files listed below.

TIP: You'll need to add a Login Redirect URI that matches your CloudFront URI after you've set that up. If you follow the steps in this example's blog post, you'll have this information before you create your app in Okta.

Modify vue-aws-client/src/router/index.js to use your Okta settings.

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

Modify vue-aws-server/app.js too:

const oktaJwtVerifier = new OktaJwtVerifier({
  clientId: '{clientId}',
  issuer: 'https://{yourOktaDomain}/oauth2/default'
})

Links

This example uses the following open source libraries provided by Okta:

Help

Please post any questions as comments on the blog post, or visit our Okta Developer Forums. You can also email [email protected] if would like to create a support ticket.

License

Apache 2.0, see LICENSE.

okta-secure-vue-aws-client-example's People

Contributors

bparise avatar imgbotapp avatar mraible avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.