Package io.meeds.dapp.web.security
Class DeedAuthenticationProvider
java.lang.Object
io.meeds.dapp.web.security.DeedAuthenticationProvider
- All Implemented Interfaces:
org.springframework.security.authentication.AuthenticationProvider
@Component
public class DeedAuthenticationProvider
extends Object
implements org.springframework.security.authentication.AuthenticationProvider
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.security.core.Authenticationauthenticate(org.springframework.security.core.Authentication authentication) booleanbooleanvalidateSignedMessage(String walletAddress, String rawMessage, String signedMessage)
-
Field Details
-
USER_ROLE_NAME
- See Also:
-
-
Constructor Details
-
DeedAuthenticationProvider
public DeedAuthenticationProvider()
-
-
Method Details
-
authenticate
public org.springframework.security.core.Authentication authenticate(org.springframework.security.core.Authentication authentication) throws org.springframework.security.core.AuthenticationException - Specified by:
authenticatein interfaceorg.springframework.security.authentication.AuthenticationProvider- Throws:
org.springframework.security.core.AuthenticationException
-
supports
- Specified by:
supportsin interfaceorg.springframework.security.authentication.AuthenticationProvider
-
validateSignedMessage
public boolean validateSignedMessage(String walletAddress, String rawMessage, String signedMessage) throws UnsupportedEncodingException, SignatureException - Parameters:
walletAddress- wallet Address (wallet public key)rawMessage- raw signed messagesignedMessage- encrypted message- Returns:
- true if the message has been decrypted successfully, else false
- Throws:
UnsupportedEncodingException- when UTF-8 isn't recognized as Encoding CharsetSignatureException- when an error occurs while decrypting signed message
-