The tutorial lets you implement LoginRadius user registration, login, and view profile on your Vue.js based application.
Create an account to get started if you don’t have one yet!
When you signed up for the LoginRadius account, it created an app for you. This app is linked to a ready to use web page - Auth Page (IDX).
Auth Page (IDX) reflects the configuration changes that you make in LoginRadius Dashboard. You can utilize this webpage for authentication requirements on your Vue.js application.
In your LoginRadius Dashboard, select your app, then navigate to the Auth Page (IDX) section located in the left navigation bar and click the Theme Customization section. There you can select a design theme for your login page, or further customize the content displayed:
To preview your login page’s theme, click the Go to your Login Page link highlighted on the above screen.
Features like Email and Password login, User registration, Forgot password, and Remember me are already configured on your Auth Page(IDX).
Before using any of the APIs or Methods that LoginRadius provides, you need to get your App Name, API Key, and API Secret.
In your LoginRadius Dashboard, navigate to Configuration > API Credentials and click the API Key And Secret subsection to retrieve your API Credentials.
Before running a Vue.js app locally, we need NodeJS. NodeJS framework helps in executing JS code without browser.
Follow these guides to setup NodeJS on your PC:
After installation, (re)start your terminal and type
npm -v. You might see a version number displayed in your terminal such as:
NodeJS is successfully installed and now we’ll use
npm (Node packet manager) to install Vue.js.
In the terminal type following command :
npm install -g @vue/cli
This tutorial uses Auth Page(IDX) for authentication, where Registration and Login functionality is already implemented.
Navigate your Register or Login links or buttons to the following URLs:
Registration Page URL:
https://<LoginRadius APP Name>.hub.loginradius.com/auth.aspx?action=register&return_url=<Return URL>
Login Page URL:
https://<LoginRadius APP Name>.hub.loginradius.com/auth.aspx?action=login&return_url=<Return URL>
- LoginRadius App Name is the name of your app as mentioned in the Get Credentials step.
- return_url is where you want to redirect users upon successful registration or login. Whitelist your domain if you are not using Local Domain for this tutorial.
return_url can be your website, frontend app, or backend server url where you are handling the access token.
This section explains the steps included in the setup of the Vue.JS demo and how to run the demo.
- Clone the Vue demo from GitHub Repo here
- Install the dependencies by typing
npm installon your command-line interface.
- Configure your LoginRadius Credentials in
- Run the demo on localhost port 8080 by typing
npm run devinto your command-line interface.
- This will open your demo on your default browser.
- Create a user by clicking on Register Here, upon successful user creation you’ll be redirected to Login page
- Log in. Upon successful login, it will redirect you to the return url with the access token. In response, you will get a user profile in JSON format. Open Developer Tools in your browser, navigate to Console and you’ll find a JSON response. The following displays a sample JSON response:
Below is the list of features that are included in this demo.
- Resend Email Verification
- Social Login
To whitelist your domain, in your LoginRadius Dashboard, navigate to Configuration > Domain Whitelisting and add your domain name: