Package com.hamidh.azad92.flash.config

Source Code of com.hamidh.azad92.flash.config.SecurityConfig

package com.hamidh.azad92.flash.config;

import org.springframework.context.annotation.*;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.security.crypto.password.StandardPasswordEncoder;
import org.springframework.security.web.authentication.rememberme.TokenBasedRememberMeServices;

import com.hamidh.azad92.flash.account.UserService;

@Configuration
@ImportResource(value = "classpath:spring-security-context.xml")
class SecurityConfig {
 
  @Bean
  public UserService userService() {
    return new UserService();
  }

  @Bean
  public TokenBasedRememberMeServices rememberMeServices() {
    return new TokenBasedRememberMeServices("remember-me-key", userService());
  }
 
  @Bean
  public PasswordEncoder passwordEncoder() {
    return new StandardPasswordEncoder();
  }
}
TOP

Related Classes of com.hamidh.azad92.flash.config.SecurityConfig

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.