Configuring web security

The first thing we need to do is create a custom web security configuration. Create a config package in com.example.messenger.api. Add a WebSecurityConfig class to the package and input the following code:

package com.example.messenger.api.configimport com.example.messenger.api.filters.JWTAuthenticationFilterimport com.example.messenger.api.filters.JWTLoginFilterimport com.example.messenger.api.services.AppUserDetailsServiceimport org.springframework.context.annotation.Configurationimport org.springframework.http.HttpMethodimport org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilderimport org.springframework.security.config.annotation.web.builders.HttpSecurityimport  ...

Get Kotlin Programming By Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.