Package io.meeds.deeds.web.security
Class DeedAuthenticationProvider
- java.lang.Object
-
- io.meeds.deeds.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 Modifier and Type Field Description static StringUSER_ROLE_NAME
-
Constructor Summary
Constructors Constructor Description DeedAuthenticationProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.security.core.Authenticationauthenticate(org.springframework.security.core.Authentication authentication)booleansupports(Class<?> authentication)booleanvalidateSignedMessage(String walletAddress, String rawMessage, String signedMessage)
-
-
-
Field Detail
-
USER_ROLE_NAME
public static final String USER_ROLE_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
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
public boolean supports(Class<?> authentication)
- 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
-
-