Skip to content

GovTechSG/techpass-spa-vue

Repository files navigation

TechPass Test App in Vue.js

This is a basic sample app created using Vue.js to showcase the JWT tokens thats an Identity Provider returns mainly using the Implicit Grant flow. Token data has been decoded and prettified for readability.

Getting Started

The project uses Vue.js. It scripts are written with Typescript. You can find out how Vue works with Typescript here.

Vue CLI Service is used to compile and serve the page locally.

Note: This app does not support sessions, so there is no data persistence.

Project Structure

  • src/components - Vue.js components
  • src/services - Services supporting user interactivities
  • src/router.ts - Vue Router for mapping components

Setup

  1. Clone the repo
  2. Run npm install or yarn install.
  3. To compile and serve: npm start or yarn run start.

You will need to provision a client id from your identity provider of choice and configure the sign in and sign out URL (and any additional parameters that the service might need).

Please refer to the corresponding guide for the managed service.

Environment Variables

The following environment variables are needed by the OIDC client in order to sign in to the identity provider (IdP).

In order to run the service locally, you will need to create a .env.local file and provide VUE_APP_PROVIDER and VUE_APP_CLIENT_ID env vars. They should not be committed into the repository.

Environment Variable Name Value Location
VUE_APP_SIGN_IN_REDIRECT_URI URL for the IdP to redirect to after successful sign in .env
VUE_APP_SIGN_OUT_REDIRECT_URI URL for the IdP to redirect to after successful sign out .env
VUE_APP_PROVIDER URL to the IdP (i.e. https://login.microsoftonline.com/common/v2.0/) .env.local
VUE_APP_CLIENT_ID ID string of the client application that you have registered with the IdP .env.local

Changelog

  • v0.1.0
    • Initial commit
  • v0.2.0
    • Remove dependency on Cognito and move to generic OIDC client.
    • Migrate code base to Typescript.

Contributing

We welcome your involvement, be it fixing bugs or implementing new features that you find relevant to this library.

To contribute, you may follow the steps below:

  1. Fork the repo
  2. Create a new branch from development to work on your contribution
  3. Create a pull request back when you are done
  4. Please refer to the ISSUES and PULL REQUEST templates when raising them. The reviewers will evaluate the request before merging into master

You can raise an issue within this Github repository to kick-start the discussion first.

License

Licensed under the MIT LICENSE

Relevant Information

Acknowledgments

Huge thank you to the almighty Google, StackOverflow and these tutorial articles and repo that was used to develop this application:

About

Sample Vue.js Application for TechPass

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •