Home » Tag Archives: Spring

Tag Archives: Spring

Secure a Spring Microservices Architecture with Spring Security and OAuth 2.0

spring-interview-questions-answers

“I love writing authentication and authorization code.” ~ No Java Developer Ever. Tired of building the same login screens over and over? Try the Okta API for hosted authentication, authorization, and multi-factor auth. Every developer wants to build faster and more efficiently, to support scale. Building a microservices architecture with Spring can add resilience and elasticity to your architecture that ...

Read More »

Spring Security with Spring Boot 2.0: UserDetailsService

spring-interview-questions-answers

As we have seen on a previous post the username and password for our spring application was configured through environmental variables. This is ok for prototype purposes however in real life scenarios we have to provide another way to make the users eligible to login to the application. To do so we use the UserDetailsService Interface. The user details service ...

Read More »

Creating a sturdy backup system

spring-interview-questions-answers

At Foreach we own a Synology RS815+ to store all our backups. These backups come from different sources in our network such as routers, switches, database servers, web servers, application log files, mail servers, and so on. The Synology NAS makes it really easy to configure file shares and quotas for these backups. However, it lacked a few features:        Monitoring ...

Read More »

Automatic save of managed JPA entities outside of transaction

java-interview-questions-answers

Repositories and transactions in Spring go hand in hand. All database access in Spring should be run inside a transaction, and you typically have @Transactional somewhere to enforce this. However, this is not always necessary. For example, when using Spring Data your repositories use SimpleJPARepository for CRUD functionality. The SimpleJPARepository uses @Transactional so when you perform CRUD operations, transactions are ...

Read More »

Spring Hibernate Tutorial

spring-interview-questions-answers

1. Introduction In this post, we shall demonstrate how to leverage the power of one of the most popular ORM (object-relational mapping) tool, Hibernate which facilitates the conversion of an object-oriented domain model to a traditional relational database. Hibernate is one of the most popular Java frameworks out there. For this reason we have provided an abundance of tutorials here ...

Read More »

2 Ways to Setup LDAP Active Directory Authentication in Java Spring Security Example Tutorial

spring-interview-questions-answers

LDAP authentication is one of the most popular authentication mechanism around the world for enterprise application and Active directory (an LDAP implementation by Microsoft for Windows) is another widely used LDAP server. In many projects, we need to authenticate against active directory using LDAP by credentials provided in the login screen. Sometimes this simple task gets tricky because of various ...

Read More »

Spring Security Concurrent Session Control Example Tutorial – How to limit number of User Session in Java JEE Web Application

spring-interview-questions-answers

If you don’t know, Spring security can limit the number of sessions a user can have. If you are developing a web application especially a secure web application in Java JEE then you must have come up with the requirement similar to online banking portals have e.g. only one session per user at a time or no concurrent session per user. Even ...

Read More »