Saturday, October 6, 2018

Basic Authentication

Full Stack Software Development Blog

Starting to implement login/authentication in the Texas TOC application.

Use the Spring Security and Angular guide as a reference to implement basic authentication.

Did not implement the reference application from the guide but instead applied the lessons to the existing Texas TOC angular front end and Texas TOC Java/Spring back end.

The Spring Security and Angular guide begins to show authentication using basic authentication at The Login Page

Angular Front End

Implemented the changes on the branch labelled 15-security-basic-auth


Module Function
app.services.ts authenticate() - set basic auth header if credential have been entered in login page
app.component.ts logout()
login.component.ts login()
xxx.component.ts ngInit() - route to login if not authenticated

Java/Spring Back End


Implemented the changes on the branch labelled 02-security-basic-auth

Module Function
TexastocApplication.java Added the security configuration to require basic authentication and allow CORS
UserController.java /user endpoint to return the principal