Home » Tag Archives: Spring Security

Tag Archives: Spring Security

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 »

Spring Security with Maven Tutorial

spring-interview-questions-answers

1. Introduction In this post, we shall demonstrate how to use Maven dependencies for Spring Security for very specific use-cases. The latest versions of all the libraries we use can be found on the Maven Central. Understanding how Maven dependencies work and are managed is important in a project for an effective build cycle and clear concepts about what versions ...

Read More »

Build Authentication the Easy Way with Spring Security 5.0 and OIDC

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. Spring Security is not just a powerful and highly customizable authentication and access-control framework, it is also the de-facto standard for securing Spring-based applications. Once upon a ...

Read More »

Angular5 JWT Authentication (Spring Boot Security)

Welcome to angular5 jwt authentication with spring security.In this tutorial, we will be creating a full stack app using jwt authentication in an angular5 single page application having backened server supported by spring boot with integration of spring security.Having said that we will have a sample angular5 example application with HttpInterceptor integrated with it to intercept all the HTTP request ...

Read More »

Spring Boot 2 native approach to SSO with OAuth 2/OpenID Connect

spring-interview-questions-answers

This post is the final part of a 3 post series exploring ways to enable SSO with an OAuth2 provider for Spring Boot 2 based applications. The 3 posts are: Ways to bootstrap an OpenID Connect compliant OAuth2 Authorization Server/OpenID Provider Legacy Spring Boot/Spring 5 approach to integrating with an OAuth2 Authorization Server/OpenID Provider  Newer Spring Boot 2/Spring 5 approach ...

Read More »

Spring Boot 2 Applications and OAuth 2 – Legacy Approach

spring-interview-questions-answers

This post is the second part of a 3 post series exploring ways to enable SSO with an OAuth2 provider for Spring Boot 2 based applications. The 3 posts are: 1.Ways to bootstrap an OpenID Connect compliant OAuth2 Authorization Server/OpenID Provider 2. Legacy Spring Boot/Spring 5 approach to integrating with an OAuth2 Authorization Server/OpenID Provider – this post 3. Newer ...

Read More »

What is SecurityContext and SecurityContextHolder in Spring Security?

spring-interview-questions-answers

The SecurityContext and SecurityContextHolder are two fundamental classes of Spring Security. The SecurityContext is used to store the details of the currently authenticated user, also known as a principle. So, if you have to get the username or any other user details, you need to get this SecurityContext first. The SecurityContextHolder is a helper class, which provide access to the security context. ...

Read More »

How Http Basic Authentication works in Spring Security?

spring-interview-questions-answers

In the last article, you have learned how to enable Http basic authentication in Spring security based Java application and now we’ll go one step further to understand how exactly http basic authentication works in Spring security. If you remember, when you use HTTP Basic for authentication purpose the client e.g. browser or a rest client sends login credentials in http ...

Read More »