CognitoDemo is a Java application, constructed with the Spring framework (Spring Boot and Spring MVC). This application shows how AWS Cognito can be used for server side authentication.
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.settings Initial commit Nov 14, 2018
src When the user is logged in, an access to the root web page is routed … Dec 7, 2018
target Initial commit Nov 14, 2018
.classpath Initial commit Nov 14, 2018
.gitignore Create .gitignore Nov 14, 2018
.project Initial commit Nov 14, 2018
LICENSE Initial commit Nov 14, 2018
README.md Update README.md Nov 16, 2018
mvnw Initial commit Nov 14, 2018
mvnw.cmd Initial commit Nov 14, 2018
pom.xml Initial commit Nov 14, 2018

README.md

CognitoDemo

Introduction

CognitoDemo is a Java application, constructed with the Spring framework (Spring Boot and Spring MVC). This application shows how Amazon Web Services (AWS) Cognito can be used for server side authentication.

AWS Cognito is a multi-faceted authentication service. Cognito reduces the amount of software that has to be written to support login, account creation and user information update. Cognito is a "pay as you go" service, which does not incur the 24-hour a day, 7-days a week cost of an authentication service that is supported by a database server.

One barrier to leveraging Cognito in a Java application is the lack of documentation when it comes to writing Java code that references the Cognito API. This application includes the AuthenticationService object which contains all (most) of the functions you will need to implement server side authentication using Cognito.

This open source software was developed by Topstone Software Consulting. An article that discusses Cognito and this demonstration application can be found here.

Application Structure

The Cognito demonstration application is a Spring application. It consists of three major components:

  • Controllers
    The Spring controllers provide the server side logic for the web pages (e.g., form input validation and processing). Most of the controllers have separate functions that process HTTP GET and POST operations.
  • View
    The view contains the Java Server Pages (JSP) web pages. Each web page corresponds to a controller class.
  • Services
    The services package contains the code that supports the controllers. In this demo application the core class is AuthenticationService, which implements the AuthenticationInterface. The AuthenticationService class contains the code that interfaces with Cognito.

Please see the Topstone Software article on this application for more detail.