Class AuthServiceImpl
- java.lang.Object
-
- io.mosip.kernel.auth.defaultimpl.service.impl.AuthServiceImpl
-
- All Implemented Interfaces:
AuthNService,AuthService,AuthZService
@Profile("!local") @Service public class AuthServiceImpl extends Object implements AuthServiceAuth Service for Authentication and Authorization- Author:
- Ramadurai Pandian, Urvil Joshi, Srinivasan
-
-
Constructor Summary
Constructors Constructor Description AuthServiceImpl()
-
Method Summary
-
-
-
Method Detail
-
validateToken
public MosipUserTokenDto validateToken(String token) throws Exception
Method used for validating Auth token- Specified by:
validateTokenin interfaceAuthZService- Parameters:
token- token- Returns:
- mosipUserDtoToken is of type
MosipUserTokenDto - Throws:
Exception- exception
-
authenticateUser
public AuthNResponseDto authenticateUser(LoginUser loginUser) throws Exception
Method used for Authenticating User based on username and password- Specified by:
authenticateUserin interfaceAuthNService- Parameters:
loginUser- is of typeLoginUser- Returns:
- authNResponseDto is of type
AuthNResponseDto - Throws:
Exception- exception
-
authenticateWithOtp
public AuthNResponseDto authenticateWithOtp(OtpUser otpUser) throws Exception
Method used for sending OTP- Specified by:
authenticateWithOtpin interfaceAuthNService- Parameters:
otpUser- is of typeOtpUser- Returns:
- authNResponseDto is of type
AuthNResponseDto - Throws:
Exception- exception
-
authenticateUserWithOtp
public AuthNResponseDto authenticateUserWithOtp(UserOtp userOtp) throws Exception
Method used for Authenticating User based with username and OTP- Specified by:
authenticateUserWithOtpin interfaceAuthNService- Parameters:
userOtp- is of typeUserOtp- Returns:
- authNResponseDto is of type
AuthNResponseDto - Throws:
Exception- exception
-
authenticateWithSecretKey
public AuthNResponseDto authenticateWithSecretKey(ClientSecret clientSecret) throws Exception
Method used for Authenticating User based with secretkey and password- Specified by:
authenticateWithSecretKeyin interfaceAuthNService- Parameters:
clientSecret- is of typeClientSecret- Returns:
- authNResponseDto is of type
AuthNResponseDto - Throws:
Exception- exception
-
refreshToken
public RefreshTokenResponse refreshToken(String appID, String refreshToken, RefreshTokenRequest refreshTokenRequest) throws Exception
Method used for generating refresh token- Specified by:
refreshTokenin interfaceAuthService- Parameters:
refreshToken- existing refresh token- Returns:
- mosipUserDtoToken is of type
MosipUserTokenDto - Throws:
Exception- exception
-
invalidateToken
public AuthNResponse invalidateToken(String token) throws Exception
Method used for invalidate token- Specified by:
invalidateTokenin interfaceAuthService- Parameters:
token- token- Returns:
- authNResponse is of type
AuthNResponse - Throws:
Exception- exception
-
getAllRoles
public RolesListDto getAllRoles(String appId)
- Specified by:
getAllRolesin interfaceAuthService
-
getListOfUsersDetails
public MosipUserListDto getListOfUsersDetails(List<String> userDetails, String appId) throws Exception
- Specified by:
getListOfUsersDetailsin interfaceAuthService- Throws:
Exception
-
getAllUserDetailsWithSalt
public MosipUserSaltListDto getAllUserDetailsWithSalt(List<String> userDetails, String appId) throws Exception
- Specified by:
getAllUserDetailsWithSaltin interfaceAuthService- Throws:
Exception
-
getRidBasedOnUid
public RIdDto getRidBasedOnUid(String userId, String appId) throws Exception
- Specified by:
getRidBasedOnUidin interfaceAuthService- Throws:
Exception
-
unBlockUser
@Deprecated public AuthZResponseDto unBlockUser(String userId, String appId) throws Exception
Deprecated.- Specified by:
unBlockUserin interfaceAuthService- Throws:
Exception
-
changePassword
@Deprecated public AuthZResponseDto changePassword(String appId, PasswordDto passwordDto) throws Exception
Deprecated.- Specified by:
changePasswordin interfaceAuthService- Throws:
Exception
-
resetPassword
@Deprecated public AuthZResponseDto resetPassword(String appId, PasswordDto passwordDto) throws Exception
Deprecated.- Specified by:
resetPasswordin interfaceAuthService- Throws:
Exception
-
getUserNameBasedOnMobileNumber
@Deprecated public UserNameDto getUserNameBasedOnMobileNumber(String appId, String mobileNumber) throws Exception
Deprecated.- Specified by:
getUserNameBasedOnMobileNumberin interfaceAuthService- Throws:
Exception
-
registerUser
public MosipUserDto registerUser(UserRegistrationRequestDto userCreationRequestDto)
- Specified by:
registerUserin interfaceAuthService
-
addUserPassword
@Deprecated public UserPasswordResponseDto addUserPassword(UserPasswordRequestDto userPasswordRequestDto)
Deprecated.- Specified by:
addUserPasswordin interfaceAuthService
-
getUserRole
public UserRoleDto getUserRole(String appId, String userId) throws Exception
- Specified by:
getUserRolein interfaceAuthService- Throws:
Exception
-
getUserDetailBasedonMobileNumber
@Deprecated public MosipUserDto getUserDetailBasedonMobileNumber(String appId, String mobileNumber) throws Exception
Deprecated.- Specified by:
getUserDetailBasedonMobileNumberin interfaceAuthService- Throws:
Exception
-
validateUserName
@Deprecated public ValidationResponseDto validateUserName(String appId, String userName)
Deprecated.- Specified by:
validateUserNamein interfaceAuthService
-
getUserDetailBasedOnUserId
public UserDetailsResponseDto getUserDetailBasedOnUserId(String appId, List<String> userIds)
- Specified by:
getUserDetailBasedOnUserIdin interfaceAuthService
-
valdiateToken
public MosipUserDto valdiateToken(String token)
- Specified by:
valdiateTokenin interfaceAuthService
-
logoutUser
public AuthResponseDto logoutUser(String token)
- Specified by:
logoutUserin interfaceAuthService
-
loginRedirect
public AccessTokenResponseDTO loginRedirect(String state, String sessionState, String code, String stateCookie, String redirectURI)
- Specified by:
loginRedirectin interfaceAuthService
-
getKeycloakURI
public String getKeycloakURI(String redirectURI, String state)
- Specified by:
getKeycloakURIin interfaceAuthService
-
authenticateUser
public AuthNResponseDto authenticateUser(LoginUserWithClientId loginUser) throws Exception
- Specified by:
authenticateUserin interfaceAuthNService- Throws:
Exception
-
-