Search in sources :

Example 1 with ClaimToken

use of org.xdi.oxauth.model.uma.ClaimToken in project oxAuth by GluuFederation.

the class AccessProtectedResourceFlowWSTest method _5_authorizePermission.

@Test(dependsOnMethods = { "_4_registerPermissionForRpt" })
@Parameters({ "umaPermissionAuthorizationPath", "umaAmHost" })
public void _5_authorizePermission(String umaPermissionAuthorizationPath, String umaAmHost) {
    final RptAuthorizationRequest request = new RptAuthorizationRequest();
    request.setRpt(rpt.getRpt());
    request.setTicket(ticket.getTicket());
    request.setClaims(new ClaimTokenList().addToken(new ClaimToken("clientClaim", "clientValue")));
    final RptAuthorizationResponse response = TUma.requestAuthorization(url, umaPermissionAuthorizationPath, umaAmHost, aat, request);
    assertNotNull(response, "Token response status is null");
}
Also used : RptAuthorizationResponse(org.xdi.oxauth.model.uma.RptAuthorizationResponse) RptAuthorizationRequest(org.xdi.oxauth.model.uma.RptAuthorizationRequest) ClaimToken(org.xdi.oxauth.model.uma.ClaimToken) ClaimTokenList(org.xdi.oxauth.model.uma.ClaimTokenList) Parameters(org.testng.annotations.Parameters) Test(org.testng.annotations.Test) BaseTest(org.xdi.oxauth.BaseTest)

Example 2 with ClaimToken

use of org.xdi.oxauth.model.uma.ClaimToken in project oxAuth by GluuFederation.

the class TrustElevationWSTest method authorizePermission.

@Test(dependsOnMethods = { "registerPermissionForRpt" })
@Parameters({ "umaPermissionAuthorizationPath", "umaAmHost" })
public void authorizePermission(String umaPermissionAuthorizationPath, String umaAmHost) {
    final RptAuthorizationRequest request = new RptAuthorizationRequest();
    request.setRpt(rpt.getRpt());
    request.setTicket(ticket.getTicket());
    request.setClaims(new ClaimTokenList().addToken(new ClaimToken("clientClaim", "clientValue")));
    final RptAuthorizationResponse response = TUma.requestAuthorization(url, umaPermissionAuthorizationPath, umaAmHost, aat, request);
    assertNotNull(response, "Token response status is null");
// final RptIntrospectionResponse status = TUma.requestRptStatus(this,
// umaRptStatusPath, umaAmHost, m_pat, m_rpt.getRpt());
// UmaTestUtil.assert_(status);
}
Also used : RptAuthorizationResponse(org.xdi.oxauth.model.uma.RptAuthorizationResponse) RptAuthorizationRequest(org.xdi.oxauth.model.uma.RptAuthorizationRequest) ClaimToken(org.xdi.oxauth.model.uma.ClaimToken) ClaimTokenList(org.xdi.oxauth.model.uma.ClaimTokenList) Parameters(org.testng.annotations.Parameters) Test(org.testng.annotations.Test) BaseTest(org.xdi.oxauth.BaseTest)

Aggregations

Parameters (org.testng.annotations.Parameters)2 Test (org.testng.annotations.Test)2 BaseTest (org.xdi.oxauth.BaseTest)2 ClaimToken (org.xdi.oxauth.model.uma.ClaimToken)2 ClaimTokenList (org.xdi.oxauth.model.uma.ClaimTokenList)2 RptAuthorizationRequest (org.xdi.oxauth.model.uma.RptAuthorizationRequest)2 RptAuthorizationResponse (org.xdi.oxauth.model.uma.RptAuthorizationResponse)2