Search in sources :

Example 6 with SaltedPasswordDigest

use of edu.stanford.bmir.protege.web.shared.auth.SaltedPasswordDigest in project webprotege by protegeproject.

the class SaltedPasswordDigestReadConverterTestCase method shouldConvertLowerCaseBase16StringToSaltedPasswordDigest.

@Test
public void shouldConvertLowerCaseBase16StringToSaltedPasswordDigest() {
    SaltedPasswordDigest digest = converter.convert(encodedString.toLowerCase(Locale.ENGLISH));
    assertThat(digest.getBytes(), is(bytes));
}
Also used : SaltedPasswordDigest(edu.stanford.bmir.protege.web.shared.auth.SaltedPasswordDigest) Test(org.junit.Test)

Example 7 with SaltedPasswordDigest

use of edu.stanford.bmir.protege.web.shared.auth.SaltedPasswordDigest in project webprotege by protegeproject.

the class SaltedPasswordDigestReadConverterTestCase method shouldConvertUpperCaseBase16StringToSaltedPasswordDigest.

@Test
public void shouldConvertUpperCaseBase16StringToSaltedPasswordDigest() {
    SaltedPasswordDigest digest = converter.convert(encodedString.toUpperCase(Locale.ENGLISH));
    assertThat(digest.getBytes(), is(bytes));
}
Also used : SaltedPasswordDigest(edu.stanford.bmir.protege.web.shared.auth.SaltedPasswordDigest) Test(org.junit.Test)

Example 8 with SaltedPasswordDigest

use of edu.stanford.bmir.protege.web.shared.auth.SaltedPasswordDigest in project webprotege by protegeproject.

the class UserRecordRepository_TestCase method setUp.

@Before
public void setUp() throws Exception {
    client = new MongoClient();
    database = client.getDatabase(MongoTestUtils.getTestDbName());
    recordRepository = new UserRecordRepository(database, new UserRecordConverter());
    userId = UserId.getUserId("JaneDoe");
    userRecord = new UserRecord(userId, "Jane Doe", EMAIL_ADDRESS, "", new Salt("somebytes".getBytes()), new SaltedPasswordDigest("someotherbytes".getBytes()));
}
Also used : MongoClient(com.mongodb.MongoClient) Salt(edu.stanford.bmir.protege.web.shared.auth.Salt) SaltedPasswordDigest(edu.stanford.bmir.protege.web.shared.auth.SaltedPasswordDigest) Before(org.junit.Before)

Aggregations

SaltedPasswordDigest (edu.stanford.bmir.protege.web.shared.auth.SaltedPasswordDigest)8 Salt (edu.stanford.bmir.protege.web.shared.auth.Salt)5 Test (org.junit.Test)3 Before (org.junit.Before)2 MongoClient (com.mongodb.MongoClient)1 Md5DigestAlgorithmProvider (edu.stanford.bmir.protege.web.shared.auth.Md5DigestAlgorithmProvider)1 PasswordDigestAlgorithm (edu.stanford.bmir.protege.web.shared.auth.PasswordDigestAlgorithm)1 ResetPasswordResult (edu.stanford.bmir.protege.web.shared.chgpwd.ResetPasswordResult)1 CreateUserAccountAction (edu.stanford.bmir.protege.web.shared.user.CreateUserAccountAction)1 UserDetails (edu.stanford.bmir.protege.web.shared.user.UserDetails)1 UserId (edu.stanford.bmir.protege.web.shared.user.UserId)1 Nonnull (javax.annotation.Nonnull)1