public class SecurityRealm extends Object implements org.securityfilter.realm.SecurityRealmInterface
| Constructor and Description |
|---|
SecurityRealm() |
| Modifier and Type | Method and Description |
|---|---|
Principal |
authenticate(String username,
String password)
Authenticate a user.
|
static String |
generateHexSalt(javax.servlet.http.HttpServletRequest request)
Methode om random salt tbv hash te genereren
|
static String |
getHexSha1(byte[] salt,
String phrase)
Methode om hash te maken van wachtwoord met gebruik van salt
|
static String |
getHexSha1(String saltHex,
String phrase)
Methode om hash te maken van wachtwoord met salt
|
boolean |
isUserInRole(Principal principal,
String role)
Er zijn drie rollen, bepaald door het feit of bij een Gebruiker entity
de gemeente, regio of provincie relatie not-null is.
|
public static String generateHexSalt(javax.servlet.http.HttpServletRequest request)
request - gebruikt voor initialisatie PRNG met IP en poort van clientpublic static String getHexSha1(String saltHex, String phrase) throws NoSuchAlgorithmException, UnsupportedEncodingException
saltHex - de salt als Stringphrase - het wachtwoordNoSuchAlgorithmException - No algorithm found when digesting the salted phraseUnsupportedEncodingException - If UTF-8 for the phrase is not availablepublic static String getHexSha1(byte[] salt, String phrase) throws NoSuchAlgorithmException, UnsupportedEncodingException
salt - de salt als byte arrayphrase - het wachtwoordNoSuchAlgorithmException - No algorithm found when digesting the salted phraseUnsupportedEncodingException - If UTF-8 for the phrase is not availablepublic Principal authenticate(String username, String password)
authenticate in interface org.securityfilter.realm.SecurityRealmInterfaceusername - a usernamepassword - a plain text password, as entered by the userpublic boolean isUserInRole(Principal principal, String role)
isUserInRole in interface org.securityfilter.realm.SecurityRealmInterfaceprincipal - de principal, de rollen van de gebruikerrole - de gevraagde rolCopyright © 2018. All rights reserved.