Assumptions
This guide assumes proficiency in web application development using Angular, Typescript and Node.js
Stack: Angular 14, bootstrap, font-awesome, rxjs, TypeScript and Node.js. See package.json for more information
This reference code assumes that Haventec JWT (Direct Api Mode) has been selected while creating your application in Console. Further, you will need to refer to settings available from the Console Application Details for values required to configure your front-end application and your server.
Before you start
Please review the following articles before continuing:
You will need to have signed up your organisation in Haventec Console 2.0.
Further, you will need to have created an application which you would like to authenticate with Haventec.
Configure
Front-end project:
Your front-end network service will require the application's provisioned applicationUuid value. You will find this in your application details within Console 2.0.
Assign this value to the APPLICATION_UUID constant in your application code. An example of this can be found in the application.constants.ts file of the reference projects, described below.
Server:
Be sure to configure your local server in proxy.conf.json in the root of the the authenticate-angular-sdk folder. By default this is set to target the localhost port on which the authenticate-node-server instance will run. See authenticate-node-server for configuration details.
Running your project application
Server tokens
When your project application is running, 6-digit authentication numbers (tokens) will be requested for entry by the user. These tokens will be generated and displayed in the Node.js console log, or wherever your server logs to. Cut and paste to complete the authentication. Alternatively you can configure a mail server to send these tokens via email. Use these where prompted.
README
Please refer to the README.md files within each workspace directory for information on how to install, configure and run your project application and server.
Reference Code Overview
The >src folder of this project contains the application, assets and configuration files. Each will be explored in turn.
Please refer to the actual code pertaining to each resource mentioned for this project.
>app
Resource | Description |
Details
|
app-routing.module.ts |
Maps paths to components Defaults to landing-page (see below) |
<router-outlet> for this routing module is contained in app.component.html
Pages are generally loaded in response to navigation commands within components following network activity.
|
>constants application.constants.ts
|
Implementation specific configuration properties. |
APPLICATION_UUID: string
Please assign the Application UUID you received from Haventec Console
You can find out where to locate these values for your application here:
|
>interfaces |
Various interfaces corresponding to individual pages and the service calls and responses associated with them. Note that the properties used for the various service calls may be a subset of those available in the Haventec Authenticate APIs |
The interfaces provide definitions corresponding to:
|
>pages>landing-page |
Default route component which lists available options:
|
Upon selection, the user is routed to the relevant page:
|
>pages>login |
Login: |
|
>pages>add-user |
Add a User to this Device |
|
>pages>activate-user |
|
|
>pages>add-device |
Add a Device for an Existing User |
|
>pages>activate-device |
|
|
>pages>change-pin |
Reset your PIN on this Device
|
|
>pages>reset-pin |
|
|
>services auth.service.ts |
This service provides handles to access the Haventec Authenticate SDK local storage utilities. |
Information about this SDK is available at the following github repo page: |
>services authenticate.api.service.ts |
Provides access to server endpoints. This implementation makes requests to a Node.js server to proxy calls to the Haventec Authentication SaaS services, and provide email services. You can find more information about the sample Node.js server here: |
|
>assets
Logos, fonts and font face definitions, and various styling definitions are provided as placeholders for your own styles
Configuration
Files sitting at the root of the >src folder are those typically found in Angular applications. Please refer to relevant web training resources for more information.
Comments
0 comments
Please sign in to leave a comment.