Search in sources :

Example 6 with UmaPCT

use of org.gluu.oxauth.uma.authorization.UmaPCT in project oxAuth by GluuFederation.

the class UmaPctService method createPctAndPersist.

public UmaPCT createPctAndPersist(String clientId) {
    UmaPCT pct = createPct(clientId);
    persist(pct);
    return pct;
}
Also used : UmaPCT(org.gluu.oxauth.uma.authorization.UmaPCT)

Example 7 with UmaPCT

use of org.gluu.oxauth.uma.authorization.UmaPCT in project oxAuth by GluuFederation.

the class CleanerTimerTest method umaPct_whichIsExpiredAndDeletable_MustBeRemoved.

@Test
public void umaPct_whichIsExpiredAndDeletable_MustBeRemoved() throws StringEncrypter.EncryptionException {
    final Client client = createClient();
    clientService.persist(client);
    // 1. create pct
    UmaPCT pct = umaPctService.createPct(client.getClientId());
    umaPctService.persist(pct);
    // 2. pct exists
    assertNotNull(umaPctService.getByCode(pct.getCode()));
    // 3. clean up
    cleanerTimer.processImpl();
    cacheService.clear();
    // 4. pct exists
    assertNotNull(umaPctService.getByCode(pct.getCode()));
    final Calendar calendar = Calendar.getInstance();
    calendar.add(Calendar.MINUTE, -10);
    pct.setExpirationDate(calendar.getTime());
    umaPctService.merge(pct);
    // 5. clean up
    cleanerTimer.processImpl();
    cacheService.clear();
    // 6. no pct in persistence
    assertNull(umaPctService.getByCode(pct.getCode()));
}
Also used : UmaPCT(org.gluu.oxauth.uma.authorization.UmaPCT) Client(org.gluu.oxauth.model.registration.Client) Test(org.testng.annotations.Test) BaseComponentTest(org.gluu.oxauth.BaseComponentTest)

Aggregations

UmaPCT (org.gluu.oxauth.uma.authorization.UmaPCT)7 Client (org.gluu.oxauth.model.registration.Client)2 BaseComponentTest (org.gluu.oxauth.BaseComponentTest)1 SignatureAlgorithm (org.gluu.oxauth.model.crypto.signature.SignatureAlgorithm)1 Jwt (org.gluu.oxauth.model.jwt.Jwt)1 JwtClaims (org.gluu.oxauth.model.jwt.JwtClaims)1 JwtSigner (org.gluu.oxauth.model.token.JwtSigner)1 RptIntrospectionResponse (org.gluu.oxauth.model.uma.RptIntrospectionResponse)1 UmaPermission (org.gluu.oxauth.model.uma.persistence.UmaPermission)1 ExternalUmaRptClaimsContext (org.gluu.oxauth.service.external.context.ExternalUmaRptClaimsContext)1 UmaRPT (org.gluu.oxauth.uma.authorization.UmaRPT)1 Filter (org.gluu.search.filter.Filter)1 JSONObject (org.json.JSONObject)1 Test (org.testng.annotations.Test)1