Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package org.mm.MBlog.security.models;
- import org.springframework.security.core.userdetails.UserDetails;
- import org.springframework.security.core.userdetails.UserDetailsService;
- import org.springframework.security.core.userdetails.UsernameNotFoundException;
- public class CustomUserDetails implements UserDetailsService {
- @Override
- public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
- // Here you can implement your custom logic to load user details from database or any other source
- // For simplicity, let's create a dummy UserDetails object
- return org.springframework.security.core.userdetails.User.withUsername("username")
- .password("password")
- .roles("USER")
- .build();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement