Skip to content
This repository has been archived by the owner on Mar 20, 2024. It is now read-only.
/ cognito-example-apps Public archive

A simple client application that can be used to test an app client in the BC Gov Cognito SSO Shared Service

License

Notifications You must be signed in to change notification settings

bcgov/cognito-example-apps

Repository files navigation

cognito_example_client_app

Lifecycle:Stable

This repository contains client applications that can be used to test an app client in the BC Gov Cognito SSO Shared Service.

Next-App

An example Next.js application to connect to Cognito App client without 3rd party library or wrapper.

How to run

  • Local development environment w/o Docker
  1. Go to examples/next-app.
  2. Copy .env.example to .env.local,
  3. Set environment variables in .env.local.
  4. Run the development server:
    yarn install
    yarn dev
  • Docker based local development environment
  1. Go to examples/next-app
  2. Copy .env.example to .env,
  3. Set environment variables in .env.
  4. Run the docker-compose file:
    docker-compose up
  • Docker Compose sources environment variables from a .env file located next to the docker-compose.yml file.

Next-App-JWT

An example Next.js application to connect to Cognito App client using JWT (JSON Web Token).

Next-App-Openid

An example Next.js application to connect to Cognito App client using openid-client, which is a server side OpenID Relying Party.

React-App-Amplify

This is an example React.js application to connect to Cognito App client on client side using Amplify library.

How to run

  • Local development environment w/o Docker
  1. Go to examples/react-app-amplify.
  2. Copy src/aws-exports.js.sample to src/aws-exports.js,
  3. Set values in src/aws-exports.js.
  4. Run the development server:
    yarn install
    yarn start
  • Docker based local development environment
  1. Go to examples/react-app-amplify.
  2. Copy src/aws-exports.js.sample to src/aws-exports.js,
  3. Set values in src/aws-exports.js.
  4. Run the docker-compose file:
    docker-compose up

Next-App-PKCE

An example React.js application to connect to Cognito App client respecting OAuth 2.0 Authorization Code with PKCE Flow.

How to Contribute

If you would like to contribute, please see our CONTRIBUTING guidelines.

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

License

Apache-2.0 License

About

A simple client application that can be used to test an app client in the BC Gov Cognito SSO Shared Service

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published