Enabling Spring Boot Authorization using our own Credential.

Suresh
Nov 15, 2020

Welcome back, friends! We have learned how to enable the Spring Boot default Authorization Previous Story. Now we will be going to learn how to enable Spring Boot Authorization using our own Credentials.

In order to configure our own Credential, we have to create a Spring Security configuration class which extend from “WebSecurityConfigurerAdapter”

@Configuration
@EnableWebSecurity
public class SpringSecurityConfig extends WebSecurityConfigurerAdapter {
}

As above create a new class which extends from WebSecurityConfigurerAdapter then we need to override the following configure Method.

@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
}

In this method, we need to configure our own credentials As of now I will be going to use in-memory authentication i.e we are not fetching the user details from Database instead we are keeping the Credentials in Spring Boot memory.

For further reading please click the below link.
Enabling Spring Boot Authorization with our own Credential

--

--