Package com.bytedesk.core.rbac.auth
Class AuthService
java.lang.Object
com.bytedesk.core.rbac.auth.AuthService
https://www.baeldung.com/get-user-in-spring-security
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.modelmapper.ModelMapper
private final org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder
private final TokenRepository
private final UidUtils
private final UserDetailsServiceImpl
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.security.core.Authentication
authenticateWithPasswordHash
(AuthRequest authRequest) 密码哈希登录 - 支持AES解密 前端使用AES加密密码,后端解密后验证authenticationWithEmailAndPlatform
(String email, String platform, String client, String device) authenticationWithMobileAndPlatform
(String mobile, String platform, String client, String device) formatResponse
(org.springframework.security.core.Authentication authentication) org.springframework.security.authentication.UsernamePasswordAuthenticationToken
getAuthentication
(jakarta.servlet.http.HttpServletRequest request, String subject) getUser()
-
Field Details
-
userDetailsService
-
modelMapper
private final org.modelmapper.ModelMapper modelMapper -
uidUtils
-
tokenRepository
-
passwordEncoder
private final org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder passwordEncoder
-
-
Constructor Details
-
AuthService
public AuthService()
-
-
Method Details
-
getUser
-
getCurrentUser
-
getAuthentication
public org.springframework.security.authentication.UsernamePasswordAuthenticationToken getAuthentication(@NonNull jakarta.servlet.http.HttpServletRequest request, String subject) -
authenticationWithMobileAndPlatform
-
authenticationWithEmailAndPlatform
-
formatResponse
-
authenticateWithPasswordHash
public org.springframework.security.core.Authentication authenticateWithPasswordHash(AuthRequest authRequest) 密码哈希登录 - 支持AES解密 前端使用AES加密密码,后端解密后验证
-