public class SimpleSecurityHelper extends Object implements SecurityHelper
| Constructor and Description |
|---|
SimpleSecurityHelper(PropertyResource propertyResource,
org.springframework.security.core.userdetails.UserDetailsService userDetailsService,
org.springframework.security.crypto.password.PasswordEncoder passwordEncoder,
TokenBuilder tokenBuilder) |
| Modifier and Type | Method and Description |
|---|---|
org.springframework.security.core.Authentication |
authorize(String tokenValue)
根据令牌内容获取认证信息
|
org.springframework.security.core.userdetails.UserDetails |
authorize(String username,
String password)
根据用户账号获取用户账号信息
|
SecurityToken |
create(String username,
String password,
String sessionId)
根据用户账号创建一个安全的令牌
|
SecurityToken |
createUnsafe(String username,
String sessionId)
根据用户账号创建一个不安全的令牌
|
SecurityToken |
createUnsafe(String username,
String sessionId,
int validSeconds)
根据用户账号创建一个不安全的令牌
|
org.springframework.security.core.userdetails.UserDetails |
loadUserByUsername(String username)
根据用户账号获取用户账号信息
|
public SimpleSecurityHelper(PropertyResource propertyResource, org.springframework.security.core.userdetails.UserDetailsService userDetailsService, org.springframework.security.crypto.password.PasswordEncoder passwordEncoder, TokenBuilder tokenBuilder)
public SecurityToken createUnsafe(String username, String sessionId) throws com.yishuifengxiao.common.tool.exception.CustomException
SecurityHelpercreateUnsafe in interface SecurityHelperusername - 用户账号sessionId - 用户会话idcom.yishuifengxiao.common.tool.exception.CustomException - 创建令牌时出现问题public SecurityToken createUnsafe(String username, String sessionId, int validSeconds) throws com.yishuifengxiao.common.tool.exception.CustomException
SecurityHelpercreateUnsafe in interface SecurityHelperusername - 用户账号sessionId - 用户会话idvalidSeconds - 令牌过期时间,单位为秒com.yishuifengxiao.common.tool.exception.CustomException - 创建令牌时出现问题public SecurityToken create(String username, String password, String sessionId) throws com.yishuifengxiao.common.tool.exception.CustomException
SecurityHelpercreate in interface SecurityHelperusername - 用户账号password - 用户密码sessionId - 用户会话idcom.yishuifengxiao.common.tool.exception.CustomException - 创建令牌时出现问题public org.springframework.security.core.Authentication authorize(String tokenValue) throws com.yishuifengxiao.common.tool.exception.CustomException
SecurityHelperauthorize in interface SecurityHelpertokenValue - 令牌内容com.yishuifengxiao.common.tool.exception.CustomException - 非法的令牌public org.springframework.security.core.userdetails.UserDetails authorize(String username, String password) throws com.yishuifengxiao.common.tool.exception.CustomException
SecurityHelperauthorize in interface SecurityHelperusername - 用户账号password - 密码com.yishuifengxiao.common.tool.exception.CustomException - 非法的用户账号或密码public org.springframework.security.core.userdetails.UserDetails loadUserByUsername(String username) throws com.yishuifengxiao.common.tool.exception.CustomException
SecurityHelperloadUserByUsername in interface SecurityHelperusername - 用户账号com.yishuifengxiao.common.tool.exception.CustomException - 非法的用户账号Copyright © 2021. All rights reserved.