Home » Tag Archives: Spring (page 2)

Tag Archives: Spring

Single Sign-on for Java in 20 Minutes with Spring Boot and Heroku

spring-interview-questions-answers

Building Identity Management, including authentication and authorization? Try Stormpath! Our REST API and robust Java SDK support can eliminate your security risk and can be implemented in minutes. Sign up, and never build auth again! Massive Update The code I originally wrote for this post is more suited to non-Spring Boot environments. Stormpath’s existing Spring Boot integration for its IDSite ...

Read More »

Spring Security and Custom Password Encoding

spring-interview-questions-answers

On a previous post we added password encoding to our spring security configuration using jdbc and md5 password encoding. However in case of custom UserDetailsServices we need to make some tweeks to our security configuration. We need to create a DaoAuthenticationProvider bean and set it to the AuthenticationManagerBuilder. Since we need a Custom UserDetailsService I will use use the Spring ...

Read More »

Spring Security and Password Encoding

spring-interview-questions-answers

On previous posts we dived into spring security. We implemented security backed by jdbc, security based on custom jdbc queries and security retrieving information from a nosql database. By being careful enough we will find out that passwords are in plain text. Although this serves well for example purposes in real environments, passwords are always encoded and stored encoded in ...

Read More »

5 Practical Tips for Building Your Spring Boot API

spring-interview-questions-answers

Building Identity Management, including authentication and authorization? Try Stormpath! Our REST API and robust Java SDK support can eliminate your security risk and can be implemented in minutes. Sign up, and never build auth again! Every API developer is looking for ways to manage their application more securely, without sacrificing speed or ease of implementing new features. To that end, ...

Read More »

Spring boot with Spring Security and NoSQL

nosql-logo

In the previous post we set up a spring security configuration by providing custom queries for user and authority retrieval from an sql database. Nowadays many modern applications utilize NoSQL databases. Spring security does not come with an out of the box solution for NoSQL databases. In those case we need to provide a solution by Implementing a Custom UserDetailsService. ...

Read More »

Spring boot with Spring Security and jdbc Part 2

spring-interview-questions-answers

On a previous post we implemented security based on the default table schemas that Spring Security issues requests. Considering users and roles, application developers use a schema that fits their needs. Spring gives us the ability to specify the queries needed in order to retrieve information such as username, password and roles. Our custom tables will be pretty different from ...

Read More »

Spring boot with Spring Security and jdbc

spring-security-logo

Spring security Is a wonderful framework saving lots of time and effort from the developers. Also It is flexible enough to customize and bring it down to your needs. Working with JDBC and Spring Security is pretty easy and many actions are automated. This would be a minimal showcase. The gradle file contains dependencies such as spring-security, spring-jdbc and h2 ...

Read More »

Injecting authenticated user into Spring MVC @Controllers

spring-interview-questions-answers

Injecting injecting authenticated user into Spring MVC handler method can be done with @AuthenticationPrincipal annotation and AuthenticationPrincipalArgumentResolver that is an implementation of Spring MVS MethodArgumentResolver. AuthenticationPrincipalArgumentResolver is registered by default with web security configuration (e.g. when you enable security with @EnableWebSecurity). 1. Custom UserDetails Let’s assume we have our custom UserDetails implementation: import org.springframework.security.core.GrantedAuthority; import pl.codeleak.surveyapp.entities.Member; import java.util.Collection; public class ...

Read More »

Want to take your Java skills to the next level?

Grab our programming books for FREE!

Here are some of the eBooks you will get:

  • Spring Interview QnA
  • Multithreading & Concurrency QnA
  • JPA Minibook
  • JVM Troubleshooting Guide
  • Advanced Java
  • Java Interview QnA
  • Java Design Patterns