SlideShare a Scribd company logo
International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 09 Issue: 07 | July 2022 www.irjet.net p-ISSN: 2395-0072
© 2022, IRJET | Impact Factor value: 7.529 | ISO 9001:2008 Certified Journal | Page 2326
Developing microservices with Java and applying Spring security
framework and OAuth2
Sneha Suresh Vanjire1, Dr. Rajashekara Murthy S2
Student, Dept. of Information Science and Engineering, RV College of Engineering, Bangalore, Karnataka, India
Associate Professor, Dept. of Information Science and Engineering, RV College of Engineering, Bangalore,
Karnataka, India
---------------------------------------------------------------------***---------------------------------------------------------------------
Abstract - Today's development is mostly done using a
microservice architecture. As part of the microservices
architecture, applications are built from a number of small
modular services. In 2014, Google, Netflix and Twitter
implemented Microservice Architecture (MSA), which runs as
separate processes and communicates with each other in
different ways. Since then, these companies have widely
decoupled and implemented Microservice Architecture. With
this design, an application's services are broken down,
distributed independently, and then run. In this study, we look
at how Java microservices can be developed, as well as how
OAuth2 and the Spring Security Framework can be used to
secure microservice APIs that are built on top of the Spring
Framework.
Key Words: SpringBoot, Microservice Architecture
(MSA), Software Architecture, OAuth2, Proof of Concept
(POC), and Spring framework.
1. INTRODUCTION
Although RESTful endpoints with a single functionality are
how microservices are frequently characterized, there are
numerous different ways for developers to build these
services. The microservice architectural stylewascreated as
a result of the architectural design of Service-Oriented
Architecture and Domain-Driven Design, with a significant
focus on DevOps techniques. It has attracted a lot of interest
from academics as a trustworthy and scalable solution to
construct cloud services, and it hasalsobeenwidelyadopted
by companies with millions of clients,likeNetflixorAmazon.
In a nutshell, the microservice architecture encourages the
division of the programme into services as an unique
software architecture. According to the conventional
monolithic method of software architecture, each
deployment requires the bundle of the full applicationstack.
This idea has numerous disadvantages for the application,
including rigid scalability, significant resource costs and
refactoring effort, and challenges with DevOps amongst
scattered teams. By creating a Proof of Concept (POC) of an
MSA application utilizing the Spring Framework, Spring
Security, and OAuth2, and performing security testing over
the POC, this research aims to close the knowledge gap on
MSA and API security.
Different Ways of Creating Microservices
 RESTful endpoint-based applications operating
independently and acting as services for a certain
system characteristic.
 Creation of headless services likeAWSLambda,also
referred to as Function as a Service (FaaS).
 Services that use messaging or events to
communicate, such as clustered Vert.x vertices (the
Java Reactive framework), are known as messaging
or event-based services.
1.1 Various Microservices Libraries in Java
It can be difficult to think about the technology roadmap
while switching from such a monolithic to something like a
microservices architecture because there are so many
concepts, problems, and technological options. People could
therefore overthink the issue and overdevelop the answer
when developing a new application under a microservice
architecture. The most complete coverage for microservices
libraries is provided by the Spring framework, which is part
of the Java ecosystem.
A variety of libraries are listed with use cases in Table - 1.
Table -1: Libraries with Use Cases
Library Use cases Tools
Illustration
Discovering and
Registering Services
Manage
configurations
in a
distributed
and safe
manner
Spring Cloud
Configuration,
Consultation,
and Vault
Implementation
Management
Using
registered
service names
to locate
service nodes
Spring Cloud -
Netflix Eureka,
Consul
International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 09 Issue: 07 | July 2022 www.irjet.net p-ISSN: 2395-0072
© 2022, IRJET | Impact Factor value: 7.529 | ISO 9001:2008 Certified Journal | Page 2327
Monitoring for
Systems, JVMs, and
APIs
Performance
degradation,
risk and
crash analysis
New Relic,
Spring Boot
Admin and
Datadog
API Gateway serving as a
point of entry
and managing
issues with
security, URL
name, etc.
Zuul, Nginx,
cloud-provided
API
gateways
Security Secure socket
layer
authenticity
using a
password and
a digest,
OAUTH, and
JWT, and social
login
integrations
Spring Security
for Spring
1.2 Microservices with Java Frameworks
A new breed of Java frameworks allows you to swiftly
package an entire web service with the embedded container
of your choice in an auto running JAR file. It was
revolutionary to switch from a big, hefty J2EE container to a
smaller, lighter version. There will be a few frameworks
accessible, such as Spark, Dropwizard, and Spring Boot. We
will investigate a SpringBoot sample. The Spring framework
has been used to build Java applications for more than ten
years and is the de facto industry standard.
2. SPRINGBOOT
One important factor in Java's success in enterprise
development is the Spring Framework. Almost all of the
widely used libraries and frameworks for Java web
development are supported by this framework. We can
swiftly develop self-running microservices with SpringBoot
in a matter of minutes. In the past, developing boilerplate
code for an application's sole purpose of wiring Spring
infrastructure components required a significant amount of
development effort. The majority of the routine stuff has
already been set up for us.
Listed here are some of Spring Boot's highlights:
 Things may be rapidly set up and going.
 Overriding configuration,libraries,andframeworks
is incredibly flexible.
 There is a very robust community that can offer
answers to many potential issues.
Examine the base class for our usage cases and the Hello
World application example. This class will serve as the
foundation for our sample web application. If you want to
change or modify anything, you can use a property file, a
Metadata file, or Java-based configuration.
Define the Application class first. The Spring Boot
application's starting point and RESTful endpoint are both
provided by this short single class.
Class of Application shown in Fig -1 below.
Fig -1: Application class
An order to eliminate the need for manual project setup in
the beginning, the Spring Framework community offers an
additional facility. You cangeta rapid,ready-to-launchinitial
configuration with a list of all the Spring dependencies on
the http://www.start.spring.io website.
By default, Spring Boot loads the settings from class path
files called application. properties or application. yml.Inthis
manner, Java will finallybeusedtodevelopthemicroservice.
3. SPRING SECURITY FRAMEWORK AND OAUTH2
So we have created the microservices necessary to apply
security inorder to make secure applications.
Therefore, in order to build safe apps, we have designed the
microservices that are required to apply security.
Applications exchange information with one another across
the Internet and network communication protocols, hence
this architectural design strongly relies on APIs (API). A
microservice application's Api must be appropriately
secured as a result in order to protect the application aswell
International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 09 Issue: 07 | July 2022 www.irjet.net p-ISSN: 2395-0072
© 2022, IRJET | Impact Factor value: 7.529 | ISO 9001:2008 Certified Journal | Page 2328
as its resources against risks associated with API
invocations.
3.1 Microservice API and Microservice Architecture:
Microservice architecture (MSA) is the term for the
application architecture that divides an application into a
number of narrowly focused, single responsibilities,
portable, and independently evolving services. The typical
monolithic software architecture, in contrast, deploys the
complete application with all of its services inside just one
application server. Because REST is a lightweight protocol,
this research employs it for the API development and
experiment. MSA simply divides the application logic into
numerous smaller components; it does not make a
programme any simpler. Scalability and high availabilityare
two benefits of decomposition, but it also results in a
significantly highly complex network linkage between
components, especially whenevertheapplicationismadeup
of an excess amount of services. A comparison of the
monolithic and microservice architectures isshowninFig -2
and Fig -3.
Fig –2: Monolithic Architecture
Fig -3: Microservice Architecture
4. PROOF-OF-CONCEPT CREATION
The POC is created in order to respond to the inquiry.
Additionally, it must to demonstratehowMSAcanbeused in
actual business situations. In order to reply to the enquiry,
the POC is established. Additionally, it must show how MSA
can be applied in real-world business scenarios. This makes
a POC for such just an inventory management software an
appropriate experimental application. OAuth2 is used for
backend services that don't need a web application browser
and user interaction techniques in additional to the online
application, as seen in Fig -4. ThePOCmustbeconstructedin
a specific fashion in order to perform security checks for
both of these technology types. Additionally, OAuth 2.0
should be investigated in the experiment for both
authentication and authorization needs. Key characteristics
and actors are suggested in the following subsections in
accordance with the experimental needs.
4.1 Use cases
Use scenarios for an authorization server include:
The Identity Provider in the OAuth2 process is the
Authorization Server. The design provides the fundamental
use scenarios for the Authorization Server, as shown in
Figure 4. The following two actors communicate with the
Authorization Server:
 Owner of the resource in the OAuth2 workflow.
 The client app is the client application which has
identified with the authorisation server.
International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 09 Issue: 07 | July 2022 www.irjet.net p-ISSN: 2395-0072
© 2022, IRJET | Impact Factor value: 7.529 | ISO 9001:2008 Certified Journal | Page 2329
Fig -4: Authorization Server
Use scenarios for an resource server include:
There are two microservicesputinto placebythePOCto
manage the watch and mobile phone, respectively. The
microservices replace theRPsintheOAuthpipeline.Figure5
displays the use cases for the resource server.
Fig -5: Authorization Server
4.2 OAuth2 Authorisation Configuration
The built-in Authorization Server Configure Adapter of
the Spring Security Framework is improved by OAuth
configuration and now includes an implementation for
OAuth2 authorisation support. It offers the following key
features:
 OAuthDataSource: searchesthedatabaseforclient
information during the authorization procedure.
 TokenStore: The Java Database Connectivity
(JDBC) approach is used to access the access tokens
kept in the database as well.
 ApprovalStore: Using JDBC technology, users may
access approval data that is kept in a database.
 AuthorizationCodeServices: Authorization codes
are saved in a database, just like in the
ApprovalStore.
 Configure the ClientDetailsService by defining each
unique client and their properties with
configure(ClientDetailsServiceConfigurer clients).
 void Use the
configure(AuthorizationServerEndpointsConfigurer
endpoints) command to set up the Authorization
Server access points, including a token storage,
authenticating code service, token customizations,
user approvals, and grant types.
5. CONCLUSIONS
Just now, we looked at the standardstartingpoint.Dueto the
fact that it offers the most comprehensive solutions for the
diverse needs of any corporate system, the most of the
examples we examine from hereonoutwill utilisetheSpring
Framework. Using Spring Boot, we may split a larger
microserviceintosmallerones.Microservicesinteractwithin
the MSA application with one another using service API
endpoints. An API endpoint is a location in which the
services can connect and receive the resources they need to
perform their duties. The API endpoint, which serves as the
interface through which data is transferred between
services, is crucial in ensuring the proper operation of the
systems and services that interact with it. As a result, API
endpoint security is among the most crucial security
components in an MSA applications.Theresearcherhopesto
expand on this work in the future to include the security of
all API implementations, as well as the security of additional
application layers like the business layer and thedata access
layer. As a result, suggest an API security solution that is
more complete for the Java-based microservice application.
International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 09 Issue: 07 | July 2022 www.irjet.net p-ISSN: 2395-0072
© 2022, IRJET | Impact Factor value: 7.529 | ISO 9001:2008 Certified Journal | Page 2330
REFERENCES
[1] Y. Gong, F. Gu, K. Chen and F. Wang, "The Architecture of
Micro-services and the Separation of Frond-end and
Back-end Applied in a Campus Information System,"
2020 IEEE International Conference on Advances in
Electrical Engineering and Computer Applications(
AEECA), 2020, pp. 321-324
[2] R. Pereira, P. Simão, J. Cunha and J. Saraiva, "jStanley:
Placing a Green Thumb on Java Collections," 2018 33rd
IEEE/ACM International Conference on Automated
Software Engineering (ASE), 2018, pp. 856-859
[3] Y. Gan and C. Delimitrou,"TheArchitectural Implications
of Cloud Microservices," IEEE Computer Architecture
Letters, vol. 17, no. 2, July-Dec. 2018, pp. 155-158
[4] Hatma Suryotrisongko, Dedy Puji Jayanto, Aris
Tjahyanto, “Design and Development of Backend
Application for Public Complaint Systems Using
Microservice Spring Boot”, Procedia Computer Science,
vol. 124, 2017, pp. 736-743
[5] Y. Jayawardana, R. Fernando, G. Jayawardena, D.
Weerasooriya and I. Perera, "A Full Stack Microservices
Framework with Business Modelling," 2018 18th
International Conference on Advances in ICT for
Emerging Regions (ICTer), 2018, pp.
[6] Hatma Suryotrisongko, Dedy Puji Jayanto, Aris
Tjahyanto, “Design and Development of Backend
Application for Public Complaint Systems Using
Microservice Spring Boot”, 4th Information Systems
International Conference 2017, ISICO 2017, 6-8
November 2017, Bali, Indonesia

More Related Content

Similar to Developing microservices with Java and applying Spring security framework and OAuth2 (20)

PPTX
Microservices vs monolithics betabeers
Jesús Mª Villar Vazquez
 
ODP
Microservice Architecture JavaCro 2015
Nenad Pecanac
 
PDF
Full lifecycle of a microservice
Luigi Bennardis
 
PDF
Writing microservices in java java one-2015-10-28
Derek Ashmore
 
PDF
Writing microservices in Java -- Chicago-2015-11-10
Derek Ashmore
 
ODP
Developing Microservices using Spring - Beginner's Guide
Mohanraj Thirumoorthy
 
PDF
Will Microservices Die.pdf
RichHagarty
 
PPTX
Understanding Microservices
vguhesan
 
PPTX
Spring 1 day program
Mohit Kanwar
 
PDF
Microservices on a budget meetup
Matthew Reynolds
 
PDF
Microservices - opportunities, dilemmas and problems
Łukasz Sowa
 
PDF
SOA Latam 2015
Domingo Suarez Torres
 
PDF
Everything you need to know about Java’s Spring Boot Microservices Architectu...
ThinkODC
 
PDF
SGCE 2015 REST APIs
Domingo Suarez Torres
 
PDF
APIs distribuidos con alta escalabilidad
Software Guru
 
PDF
Microservices for the Masses with Spring Boot, JHipster, and OAuth - Switzerl...
Matt Raible
 
PDF
Microservices Security: dos and don'ts
Minded Security
 
PPTX
Spring Boot and Microservices for Scalable Java Development – Learn with CBitss
knareshofficial1
 
PDF
API’s and Micro Services 0.5
Richard Hudson
 
PPTX
Introduction to microservices
Anil Allewar
 
Microservices vs monolithics betabeers
Jesús Mª Villar Vazquez
 
Microservice Architecture JavaCro 2015
Nenad Pecanac
 
Full lifecycle of a microservice
Luigi Bennardis
 
Writing microservices in java java one-2015-10-28
Derek Ashmore
 
Writing microservices in Java -- Chicago-2015-11-10
Derek Ashmore
 
Developing Microservices using Spring - Beginner's Guide
Mohanraj Thirumoorthy
 
Will Microservices Die.pdf
RichHagarty
 
Understanding Microservices
vguhesan
 
Spring 1 day program
Mohit Kanwar
 
Microservices on a budget meetup
Matthew Reynolds
 
Microservices - opportunities, dilemmas and problems
Łukasz Sowa
 
SOA Latam 2015
Domingo Suarez Torres
 
Everything you need to know about Java’s Spring Boot Microservices Architectu...
ThinkODC
 
SGCE 2015 REST APIs
Domingo Suarez Torres
 
APIs distribuidos con alta escalabilidad
Software Guru
 
Microservices for the Masses with Spring Boot, JHipster, and OAuth - Switzerl...
Matt Raible
 
Microservices Security: dos and don'ts
Minded Security
 
Spring Boot and Microservices for Scalable Java Development – Learn with CBitss
knareshofficial1
 
API’s and Micro Services 0.5
Richard Hudson
 
Introduction to microservices
Anil Allewar
 

More from IRJET Journal (20)

PDF
Enhanced heart disease prediction using SKNDGR ensemble Machine Learning Model
IRJET Journal
 
PDF
Utilizing Biomedical Waste for Sustainable Brick Manufacturing: A Novel Appro...
IRJET Journal
 
PDF
Kiona – A Smart Society Automation Project
IRJET Journal
 
PDF
DESIGN AND DEVELOPMENT OF BATTERY THERMAL MANAGEMENT SYSTEM USING PHASE CHANG...
IRJET Journal
 
PDF
Invest in Innovation: Empowering Ideas through Blockchain Based Crowdfunding
IRJET Journal
 
PDF
SPACE WATCH YOUR REAL-TIME SPACE INFORMATION HUB
IRJET Journal
 
PDF
A Review on Influence of Fluid Viscous Damper on The Behaviour of Multi-store...
IRJET Journal
 
PDF
Wireless Arduino Control via Mobile: Eliminating the Need for a Dedicated Wir...
IRJET Journal
 
PDF
Explainable AI(XAI) using LIME and Disease Detection in Mango Leaf by Transfe...
IRJET Journal
 
PDF
BRAIN TUMOUR DETECTION AND CLASSIFICATION
IRJET Journal
 
PDF
The Project Manager as an ambassador of the contract. The case of NEC4 ECC co...
IRJET Journal
 
PDF
"Enhanced Heat Transfer Performance in Shell and Tube Heat Exchangers: A CFD ...
IRJET Journal
 
PDF
Advancements in CFD Analysis of Shell and Tube Heat Exchangers with Nanofluid...
IRJET Journal
 
PDF
Breast Cancer Detection using Computer Vision
IRJET Journal
 
PDF
Auto-Charging E-Vehicle with its battery Management.
IRJET Journal
 
PDF
Analysis of high energy charge particle in the Heliosphere
IRJET Journal
 
PDF
A Novel System for Recommending Agricultural Crops Using Machine Learning App...
IRJET Journal
 
PDF
Auto-Charging E-Vehicle with its battery Management.
IRJET Journal
 
PDF
Analysis of high energy charge particle in the Heliosphere
IRJET Journal
 
PDF
Wireless Arduino Control via Mobile: Eliminating the Need for a Dedicated Wir...
IRJET Journal
 
Enhanced heart disease prediction using SKNDGR ensemble Machine Learning Model
IRJET Journal
 
Utilizing Biomedical Waste for Sustainable Brick Manufacturing: A Novel Appro...
IRJET Journal
 
Kiona – A Smart Society Automation Project
IRJET Journal
 
DESIGN AND DEVELOPMENT OF BATTERY THERMAL MANAGEMENT SYSTEM USING PHASE CHANG...
IRJET Journal
 
Invest in Innovation: Empowering Ideas through Blockchain Based Crowdfunding
IRJET Journal
 
SPACE WATCH YOUR REAL-TIME SPACE INFORMATION HUB
IRJET Journal
 
A Review on Influence of Fluid Viscous Damper on The Behaviour of Multi-store...
IRJET Journal
 
Wireless Arduino Control via Mobile: Eliminating the Need for a Dedicated Wir...
IRJET Journal
 
Explainable AI(XAI) using LIME and Disease Detection in Mango Leaf by Transfe...
IRJET Journal
 
BRAIN TUMOUR DETECTION AND CLASSIFICATION
IRJET Journal
 
The Project Manager as an ambassador of the contract. The case of NEC4 ECC co...
IRJET Journal
 
"Enhanced Heat Transfer Performance in Shell and Tube Heat Exchangers: A CFD ...
IRJET Journal
 
Advancements in CFD Analysis of Shell and Tube Heat Exchangers with Nanofluid...
IRJET Journal
 
Breast Cancer Detection using Computer Vision
IRJET Journal
 
Auto-Charging E-Vehicle with its battery Management.
IRJET Journal
 
Analysis of high energy charge particle in the Heliosphere
IRJET Journal
 
A Novel System for Recommending Agricultural Crops Using Machine Learning App...
IRJET Journal
 
Auto-Charging E-Vehicle with its battery Management.
IRJET Journal
 
Analysis of high energy charge particle in the Heliosphere
IRJET Journal
 
Wireless Arduino Control via Mobile: Eliminating the Need for a Dedicated Wir...
IRJET Journal
 
Ad

Recently uploaded (20)

PDF
Pressure Measurement training for engineers and Technicians
AIESOLUTIONS
 
PDF
MAD Unit - 2 Activity and Fragment Management in Android (Diploma IT)
JappanMavani
 
PDF
REINFORCEMENT LEARNING IN DECISION MAKING SEMINAR REPORT
anushaashraf20
 
PDF
Water Industry Process Automation & Control Monthly July 2025
Water Industry Process Automation & Control
 
PPT
Footbinding.pptmnmkjkjkknmnnjkkkkkkkkkkkkkk
mamadoundiaye42742
 
PDF
Basic_Concepts_in_Clinical_Biochemistry_2018كيمياء_عملي.pdf
AdelLoin
 
PPTX
美国电子版毕业证南卡罗莱纳大学上州分校水印成绩单USC学费发票定做学位证书编号怎么查
Taqyea
 
PPTX
Shinkawa Proposal to meet Vibration API670.pptx
AchmadBashori2
 
PDF
PORTFOLIO Golam Kibria Khan — architect with a passion for thoughtful design...
MasumKhan59
 
PDF
Electrical Engineer operation Supervisor
ssaruntatapower143
 
PPTX
Arduino Based Gas Leakage Detector Project
CircuitDigest
 
PDF
MAD Unit - 1 Introduction of Android IT Department
JappanMavani
 
PDF
Electrical Machines and Their Protection.pdf
Nabajyoti Banik
 
PPTX
Damage of stability of a ship and how its change .pptx
ehamadulhaque
 
PPTX
What is Shot Peening | Shot Peening is a Surface Treatment Process
Vibra Finish
 
PPTX
fatigue in aircraft structures-221113192308-0ad6dc8c.pptx
aviatecofficial
 
PPTX
2025 CGI Congres - Surviving agile v05.pptx
Derk-Jan de Grood
 
PPTX
Introduction to Internal Combustion Engines - Types, Working and Camparison.pptx
UtkarshPatil98
 
PPTX
澳洲电子毕业证澳大利亚圣母大学水印成绩单UNDA学生证网上可查学历
Taqyea
 
PDF
Biomechanics of Gait: Engineering Solutions for Rehabilitation (www.kiu.ac.ug)
publication11
 
Pressure Measurement training for engineers and Technicians
AIESOLUTIONS
 
MAD Unit - 2 Activity and Fragment Management in Android (Diploma IT)
JappanMavani
 
REINFORCEMENT LEARNING IN DECISION MAKING SEMINAR REPORT
anushaashraf20
 
Water Industry Process Automation & Control Monthly July 2025
Water Industry Process Automation & Control
 
Footbinding.pptmnmkjkjkknmnnjkkkkkkkkkkkkkk
mamadoundiaye42742
 
Basic_Concepts_in_Clinical_Biochemistry_2018كيمياء_عملي.pdf
AdelLoin
 
美国电子版毕业证南卡罗莱纳大学上州分校水印成绩单USC学费发票定做学位证书编号怎么查
Taqyea
 
Shinkawa Proposal to meet Vibration API670.pptx
AchmadBashori2
 
PORTFOLIO Golam Kibria Khan — architect with a passion for thoughtful design...
MasumKhan59
 
Electrical Engineer operation Supervisor
ssaruntatapower143
 
Arduino Based Gas Leakage Detector Project
CircuitDigest
 
MAD Unit - 1 Introduction of Android IT Department
JappanMavani
 
Electrical Machines and Their Protection.pdf
Nabajyoti Banik
 
Damage of stability of a ship and how its change .pptx
ehamadulhaque
 
What is Shot Peening | Shot Peening is a Surface Treatment Process
Vibra Finish
 
fatigue in aircraft structures-221113192308-0ad6dc8c.pptx
aviatecofficial
 
2025 CGI Congres - Surviving agile v05.pptx
Derk-Jan de Grood
 
Introduction to Internal Combustion Engines - Types, Working and Camparison.pptx
UtkarshPatil98
 
澳洲电子毕业证澳大利亚圣母大学水印成绩单UNDA学生证网上可查学历
Taqyea
 
Biomechanics of Gait: Engineering Solutions for Rehabilitation (www.kiu.ac.ug)
publication11
 
Ad

Developing microservices with Java and applying Spring security framework and OAuth2

  • 1. International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056 Volume: 09 Issue: 07 | July 2022 www.irjet.net p-ISSN: 2395-0072 © 2022, IRJET | Impact Factor value: 7.529 | ISO 9001:2008 Certified Journal | Page 2326 Developing microservices with Java and applying Spring security framework and OAuth2 Sneha Suresh Vanjire1, Dr. Rajashekara Murthy S2 Student, Dept. of Information Science and Engineering, RV College of Engineering, Bangalore, Karnataka, India Associate Professor, Dept. of Information Science and Engineering, RV College of Engineering, Bangalore, Karnataka, India ---------------------------------------------------------------------***--------------------------------------------------------------------- Abstract - Today's development is mostly done using a microservice architecture. As part of the microservices architecture, applications are built from a number of small modular services. In 2014, Google, Netflix and Twitter implemented Microservice Architecture (MSA), which runs as separate processes and communicates with each other in different ways. Since then, these companies have widely decoupled and implemented Microservice Architecture. With this design, an application's services are broken down, distributed independently, and then run. In this study, we look at how Java microservices can be developed, as well as how OAuth2 and the Spring Security Framework can be used to secure microservice APIs that are built on top of the Spring Framework. Key Words: SpringBoot, Microservice Architecture (MSA), Software Architecture, OAuth2, Proof of Concept (POC), and Spring framework. 1. INTRODUCTION Although RESTful endpoints with a single functionality are how microservices are frequently characterized, there are numerous different ways for developers to build these services. The microservice architectural stylewascreated as a result of the architectural design of Service-Oriented Architecture and Domain-Driven Design, with a significant focus on DevOps techniques. It has attracted a lot of interest from academics as a trustworthy and scalable solution to construct cloud services, and it hasalsobeenwidelyadopted by companies with millions of clients,likeNetflixorAmazon. In a nutshell, the microservice architecture encourages the division of the programme into services as an unique software architecture. According to the conventional monolithic method of software architecture, each deployment requires the bundle of the full applicationstack. This idea has numerous disadvantages for the application, including rigid scalability, significant resource costs and refactoring effort, and challenges with DevOps amongst scattered teams. By creating a Proof of Concept (POC) of an MSA application utilizing the Spring Framework, Spring Security, and OAuth2, and performing security testing over the POC, this research aims to close the knowledge gap on MSA and API security. Different Ways of Creating Microservices  RESTful endpoint-based applications operating independently and acting as services for a certain system characteristic.  Creation of headless services likeAWSLambda,also referred to as Function as a Service (FaaS).  Services that use messaging or events to communicate, such as clustered Vert.x vertices (the Java Reactive framework), are known as messaging or event-based services. 1.1 Various Microservices Libraries in Java It can be difficult to think about the technology roadmap while switching from such a monolithic to something like a microservices architecture because there are so many concepts, problems, and technological options. People could therefore overthink the issue and overdevelop the answer when developing a new application under a microservice architecture. The most complete coverage for microservices libraries is provided by the Spring framework, which is part of the Java ecosystem. A variety of libraries are listed with use cases in Table - 1. Table -1: Libraries with Use Cases Library Use cases Tools Illustration Discovering and Registering Services Manage configurations in a distributed and safe manner Spring Cloud Configuration, Consultation, and Vault Implementation Management Using registered service names to locate service nodes Spring Cloud - Netflix Eureka, Consul
  • 2. International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056 Volume: 09 Issue: 07 | July 2022 www.irjet.net p-ISSN: 2395-0072 © 2022, IRJET | Impact Factor value: 7.529 | ISO 9001:2008 Certified Journal | Page 2327 Monitoring for Systems, JVMs, and APIs Performance degradation, risk and crash analysis New Relic, Spring Boot Admin and Datadog API Gateway serving as a point of entry and managing issues with security, URL name, etc. Zuul, Nginx, cloud-provided API gateways Security Secure socket layer authenticity using a password and a digest, OAUTH, and JWT, and social login integrations Spring Security for Spring 1.2 Microservices with Java Frameworks A new breed of Java frameworks allows you to swiftly package an entire web service with the embedded container of your choice in an auto running JAR file. It was revolutionary to switch from a big, hefty J2EE container to a smaller, lighter version. There will be a few frameworks accessible, such as Spark, Dropwizard, and Spring Boot. We will investigate a SpringBoot sample. The Spring framework has been used to build Java applications for more than ten years and is the de facto industry standard. 2. SPRINGBOOT One important factor in Java's success in enterprise development is the Spring Framework. Almost all of the widely used libraries and frameworks for Java web development are supported by this framework. We can swiftly develop self-running microservices with SpringBoot in a matter of minutes. In the past, developing boilerplate code for an application's sole purpose of wiring Spring infrastructure components required a significant amount of development effort. The majority of the routine stuff has already been set up for us. Listed here are some of Spring Boot's highlights:  Things may be rapidly set up and going.  Overriding configuration,libraries,andframeworks is incredibly flexible.  There is a very robust community that can offer answers to many potential issues. Examine the base class for our usage cases and the Hello World application example. This class will serve as the foundation for our sample web application. If you want to change or modify anything, you can use a property file, a Metadata file, or Java-based configuration. Define the Application class first. The Spring Boot application's starting point and RESTful endpoint are both provided by this short single class. Class of Application shown in Fig -1 below. Fig -1: Application class An order to eliminate the need for manual project setup in the beginning, the Spring Framework community offers an additional facility. You cangeta rapid,ready-to-launchinitial configuration with a list of all the Spring dependencies on the http://www.start.spring.io website. By default, Spring Boot loads the settings from class path files called application. properties or application. yml.Inthis manner, Java will finallybeusedtodevelopthemicroservice. 3. SPRING SECURITY FRAMEWORK AND OAUTH2 So we have created the microservices necessary to apply security inorder to make secure applications. Therefore, in order to build safe apps, we have designed the microservices that are required to apply security. Applications exchange information with one another across the Internet and network communication protocols, hence this architectural design strongly relies on APIs (API). A microservice application's Api must be appropriately secured as a result in order to protect the application aswell
  • 3. International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056 Volume: 09 Issue: 07 | July 2022 www.irjet.net p-ISSN: 2395-0072 © 2022, IRJET | Impact Factor value: 7.529 | ISO 9001:2008 Certified Journal | Page 2328 as its resources against risks associated with API invocations. 3.1 Microservice API and Microservice Architecture: Microservice architecture (MSA) is the term for the application architecture that divides an application into a number of narrowly focused, single responsibilities, portable, and independently evolving services. The typical monolithic software architecture, in contrast, deploys the complete application with all of its services inside just one application server. Because REST is a lightweight protocol, this research employs it for the API development and experiment. MSA simply divides the application logic into numerous smaller components; it does not make a programme any simpler. Scalability and high availabilityare two benefits of decomposition, but it also results in a significantly highly complex network linkage between components, especially whenevertheapplicationismadeup of an excess amount of services. A comparison of the monolithic and microservice architectures isshowninFig -2 and Fig -3. Fig –2: Monolithic Architecture Fig -3: Microservice Architecture 4. PROOF-OF-CONCEPT CREATION The POC is created in order to respond to the inquiry. Additionally, it must to demonstratehowMSAcanbeused in actual business situations. In order to reply to the enquiry, the POC is established. Additionally, it must show how MSA can be applied in real-world business scenarios. This makes a POC for such just an inventory management software an appropriate experimental application. OAuth2 is used for backend services that don't need a web application browser and user interaction techniques in additional to the online application, as seen in Fig -4. ThePOCmustbeconstructedin a specific fashion in order to perform security checks for both of these technology types. Additionally, OAuth 2.0 should be investigated in the experiment for both authentication and authorization needs. Key characteristics and actors are suggested in the following subsections in accordance with the experimental needs. 4.1 Use cases Use scenarios for an authorization server include: The Identity Provider in the OAuth2 process is the Authorization Server. The design provides the fundamental use scenarios for the Authorization Server, as shown in Figure 4. The following two actors communicate with the Authorization Server:  Owner of the resource in the OAuth2 workflow.  The client app is the client application which has identified with the authorisation server.
  • 4. International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056 Volume: 09 Issue: 07 | July 2022 www.irjet.net p-ISSN: 2395-0072 © 2022, IRJET | Impact Factor value: 7.529 | ISO 9001:2008 Certified Journal | Page 2329 Fig -4: Authorization Server Use scenarios for an resource server include: There are two microservicesputinto placebythePOCto manage the watch and mobile phone, respectively. The microservices replace theRPsintheOAuthpipeline.Figure5 displays the use cases for the resource server. Fig -5: Authorization Server 4.2 OAuth2 Authorisation Configuration The built-in Authorization Server Configure Adapter of the Spring Security Framework is improved by OAuth configuration and now includes an implementation for OAuth2 authorisation support. It offers the following key features:  OAuthDataSource: searchesthedatabaseforclient information during the authorization procedure.  TokenStore: The Java Database Connectivity (JDBC) approach is used to access the access tokens kept in the database as well.  ApprovalStore: Using JDBC technology, users may access approval data that is kept in a database.  AuthorizationCodeServices: Authorization codes are saved in a database, just like in the ApprovalStore.  Configure the ClientDetailsService by defining each unique client and their properties with configure(ClientDetailsServiceConfigurer clients).  void Use the configure(AuthorizationServerEndpointsConfigurer endpoints) command to set up the Authorization Server access points, including a token storage, authenticating code service, token customizations, user approvals, and grant types. 5. CONCLUSIONS Just now, we looked at the standardstartingpoint.Dueto the fact that it offers the most comprehensive solutions for the diverse needs of any corporate system, the most of the examples we examine from hereonoutwill utilisetheSpring Framework. Using Spring Boot, we may split a larger microserviceintosmallerones.Microservicesinteractwithin the MSA application with one another using service API endpoints. An API endpoint is a location in which the services can connect and receive the resources they need to perform their duties. The API endpoint, which serves as the interface through which data is transferred between services, is crucial in ensuring the proper operation of the systems and services that interact with it. As a result, API endpoint security is among the most crucial security components in an MSA applications.Theresearcherhopesto expand on this work in the future to include the security of all API implementations, as well as the security of additional application layers like the business layer and thedata access layer. As a result, suggest an API security solution that is more complete for the Java-based microservice application.
  • 5. International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056 Volume: 09 Issue: 07 | July 2022 www.irjet.net p-ISSN: 2395-0072 © 2022, IRJET | Impact Factor value: 7.529 | ISO 9001:2008 Certified Journal | Page 2330 REFERENCES [1] Y. Gong, F. Gu, K. Chen and F. Wang, "The Architecture of Micro-services and the Separation of Frond-end and Back-end Applied in a Campus Information System," 2020 IEEE International Conference on Advances in Electrical Engineering and Computer Applications( AEECA), 2020, pp. 321-324 [2] R. Pereira, P. Simão, J. Cunha and J. Saraiva, "jStanley: Placing a Green Thumb on Java Collections," 2018 33rd IEEE/ACM International Conference on Automated Software Engineering (ASE), 2018, pp. 856-859 [3] Y. Gan and C. Delimitrou,"TheArchitectural Implications of Cloud Microservices," IEEE Computer Architecture Letters, vol. 17, no. 2, July-Dec. 2018, pp. 155-158 [4] Hatma Suryotrisongko, Dedy Puji Jayanto, Aris Tjahyanto, “Design and Development of Backend Application for Public Complaint Systems Using Microservice Spring Boot”, Procedia Computer Science, vol. 124, 2017, pp. 736-743 [5] Y. Jayawardana, R. Fernando, G. Jayawardena, D. Weerasooriya and I. Perera, "A Full Stack Microservices Framework with Business Modelling," 2018 18th International Conference on Advances in ICT for Emerging Regions (ICTer), 2018, pp. [6] Hatma Suryotrisongko, Dedy Puji Jayanto, Aris Tjahyanto, “Design and Development of Backend Application for Public Complaint Systems Using Microservice Spring Boot”, 4th Information Systems International Conference 2017, ISICO 2017, 6-8 November 2017, Bali, Indonesia