Search in sources :

Example 1 with CustomCredential

use of org.wildfly.test.integration.security.picketlink.idm.credentials.CustomCredential in project wildfly by wildfly.

the class CustomCredentialHandlerTestCase method testCustomCredential.

@InSequence(99)
@Test
public void testCustomCredential() {
    PartitionManager partitionManager = getPartitionManager();
    IdentityManager identityManager = partitionManager.createIdentityManager();
    CustomCredential credentials = new CustomCredential("valid_token");
    identityManager.validateCredentials(credentials);
    assertEquals(Credentials.Status.VALID, credentials.getStatus());
    credentials = new CustomCredential("invalid_token");
    identityManager.validateCredentials(credentials);
    assertEquals(Credentials.Status.INVALID, credentials.getStatus());
}
Also used : IdentityManager(org.picketlink.idm.IdentityManager) PartitionManager(org.picketlink.idm.PartitionManager) CustomCredential(org.wildfly.test.integration.security.picketlink.idm.credentials.CustomCredential) InSequence(org.jboss.arquillian.junit.InSequence) Test(org.junit.Test)

Aggregations

InSequence (org.jboss.arquillian.junit.InSequence)1 Test (org.junit.Test)1 IdentityManager (org.picketlink.idm.IdentityManager)1 PartitionManager (org.picketlink.idm.PartitionManager)1 CustomCredential (org.wildfly.test.integration.security.picketlink.idm.credentials.CustomCredential)1