Skip to content

sreenudoosari/spring-jersey-postgresql-basic-auth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

spring-jersey-postgresql-basic-auth

This project provides support for using Spring Security with Basic Auth in a Spring boot Jersey application using PostgreSQL database.

Getting Started

Download or clone from GIT and then use Maven (3.*) and Java (1.7 or better).

Basic Auth.

The basic access authentication is a method designed to allow a web browser, or other client program, to provide credentials in the form of a user name and password when making a request.

Before transmission, the user name is appended with a colon and concatenated with the password. The resulting string is encoded with the Base64 algorithm.

One thing I would like to mention regarding Basic Auth is, Security is not the intent of the encoding step in Basic Auth. Rather, the intent of the encoding is to encode non-HTTP-compatible characters that may be in the user name or password into those that are HTTP-compatible.

How Secure is a Basic Auth ?

The Basic Auth mechanism provides no confidentiality protection for the transmitted credentials. They are merely encoded with Base64 in transit, but not encrypted or hashed in any way. HTTPS is, therefore, typically preferred to use in conjunction with Basic Authentication.

Tech Stack for this sample

SpringBoot , makes it easy to create stand-alone, production-grade Spring based Applications.
Jersey, one of the leading frameworks to develop RESTful Web services.
PostgreSQL, popular opensource DB.

Test

The DB Script is provided in the resources package.

Get Postman Tool
Secured URI : http://localhost:8080/products/secure
In Authorization Tab ,choose Type = Basic Auth , fill the username and password and Click Update Request.
Postman will update the header with Authorization key and value. Now fire the request.

Open/Public URI : http://localhost:8080/products

About

This project provides support for using Spring Security with Basic Auth in a Spring boot Jersey application using PostgreSQL database.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors