Vue.js and Express example application that uses the OAuth 2 Authorization

Vue.js and Express example application that uses the OAuth 2 Authorization

FusionAuth Example Vue .Vue.js and Express example application that uses the OAuth 2 Authorization Code grant

FusionAuth Example Vue

Vue.js and Express example application that uses the OAuth 2 Authorization Code grant.

finished_application

Blog post

You can read full instructions with additional info and context on the blog post: https://fusionauth.io/blog/2020/08/06/securely-implement-oauth-vuejs

This application will use an OAuth Authorization Code workflow and the PKCE extension to log users in and an express backend server to store your access token securely. PKCE stands for Proof Key for Code Exchange, and is often pronounced “pixie”.

Setup

Following setup is required before running the application.

FusionAuth

If you haven't already have an instance of FusionAuth running on local machine, follow this 5-Minute Setup Guide which will get you started in no time. For quick installation and configuration, Docker is the perfect choice.

Node/NPM

Make sure you have Node installed on your local development machine.

Configuration

  • Clone this repository.

git clone https://github.com/FusionAuth/fusionauth-example-vue.git

  • Create a new Application in your FusionAuth dashboard.

  • In your application OAuth tab:

    • Set Authorized redirect URLs to http://localhost:9000/oauth-callback
    • Set Logout URL to http://localhost:8081 or the port your Vue App is running.
  • Select Users on the dashboard, select Manage and go to the Registration tab. Then click Add Registration, and add yourself to the application you just created.

  • Copy your app's Client ID, Client Secret, Redirect URI, Application ID, and API Key into the server/.env.example file, you will also need to rename .env.example to .env

SERVER_PORT = 9000
FUSIONAUTH_PORT = 9011
CLIENT_ID = ''
CLIENT_SECRET = ''
REDIRECT_URI = 'http://localhost:9000/oauth-callback'
APLICATION_ID =  ''
API_KEY = ''

You can read how to create an API KEY here.

  • Make sure FusionAuth is running, then install dependencies and start the app. The Vue app should automatically open in your browser at http://localhost:8081.
cd server
npm install
npm run dev
cd client
npm install
npm run serve

Your application is now running and you will be prompted to Sign In.

Download Details:

Author: FusionAuth

Source Code: https://github.com/FusionAuth/fusionauth-example-vue

vue vuejs javascript

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

8 Popular Websites That Use The Vue.JS Framework

In this article, we are going to list out the most popular websites using Vue JS as their frontend framework. Vue JS is one of those elite progressive JavaScript frameworks that has huge demand in the web development industry. Many popular websites are developed using Vue in their frontend development because of its imperative features.

Vue Native is a framework to build cross platform native mobile apps using JavaScript

Vue Native is a framework to build cross platform native mobile apps using JavaScript. It is a wrapper around the APIs of React Native. So, with Vue Native, you can do everything that you can do with React Native. With Vue Native, you get

How to Make a Simple Vue Custom Select Component

In this article, you’ll learn how to build a Vue custom select component that can be easily be styled using your own CSS. In fact, it’s the same component that we use in production on Qvault, and you can see it in action on the playground.

Creating a Custom Tooltip Component in Vue

There are plenty of libraries out there that will have you up and running with a good tooltip solution in minutes. However, if you are like me, you are sick and tired of giant dependency trees that have the distinct possibility of breaking at any time.

Vue ShortKey plugin for Vue.js

Vue-ShortKey - The ultimate shortcut plugin to improve the UX .Vue-ShortKey - plugin for VueJS 2.x accepts shortcuts globaly and in a single listener.