Skip to content

Commit

Permalink
fix: brazilob jarm fapi conformance test last7 issues (#695)
Browse files Browse the repository at this point in the history
properly formatted code fix for Brazil OB JARM fapi1-advanced-final issue (new numbers on monorepo)# 310 to 315
  • Loading branch information
HemantKMehta committed Jan 25, 2022
1 parent 08f4f1f commit edab074
Show file tree
Hide file tree
Showing 5 changed files with 746 additions and 85 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import io.jans.as.client.page.PageConfig;
import io.jans.as.client.par.ParClient;
import io.jans.as.client.par.ParRequest;
import io.jans.as.model.common.GrantType;
import io.jans.as.model.common.ResponseMode;
import io.jans.as.model.common.ResponseType;
import io.jans.as.model.common.SubjectType;
Expand Down Expand Up @@ -1166,6 +1167,41 @@ public RegisterResponse registerClient(

return registerResponse;
}

public RegisterResponse registerClient(final String redirectUris, final List<ResponseType> responseTypes,
final List<GrantType> grantTypes, final String sectorIdentifierUri, final String clientJwksUri,
final SignatureAlgorithm signatureAlgorithm, final KeyEncryptionAlgorithm keyEncryptionAlgorithm,
final BlockEncryptionAlgorithm blockEncryptionAlgorithm) {
RegisterRequest registerRequest = new RegisterRequest(ApplicationType.WEB, "jans test app",
io.jans.as.model.util.StringUtils.spaceSeparatedToList(redirectUris));
registerRequest.setResponseTypes(responseTypes);
registerRequest.setGrantTypes(grantTypes);
registerRequest.setSectorIdentifierUri(sectorIdentifierUri);
registerRequest.setJwksUri(clientJwksUri);
registerRequest.setAuthorizationSignedResponseAlg(signatureAlgorithm);
registerRequest.setAuthorizationEncryptedResponseAlg(keyEncryptionAlgorithm);
registerRequest.setAuthorizationEncryptedResponseEnc(blockEncryptionAlgorithm);
registerRequest.setRequestObjectSigningAlg(signatureAlgorithm);
registerRequest.setRequestObjectEncryptionAlg(keyEncryptionAlgorithm);
registerRequest.setRequestObjectEncryptionEnc(blockEncryptionAlgorithm);
registerRequest.setUserInfoSignedResponseAlg(signatureAlgorithm);
registerRequest.setUserInfoEncryptedResponseAlg(keyEncryptionAlgorithm);
registerRequest.setUserInfoEncryptedResponseEnc(blockEncryptionAlgorithm);

RegisterClient registerClient = new RegisterClient(registrationEndpoint);
registerClient.setRequest(registerRequest);
RegisterResponse registerResponse = registerClient.exec();

showClient(registerClient);
assertEquals(registerResponse.getStatus(), 201, "Unexpected response code: " + registerResponse.getEntity());
assertNotNull(registerResponse.getClientId());
assertNotNull(registerResponse.getClientSecret());
assertNotNull(registerResponse.getRegistrationAccessToken());
assertNotNull(registerResponse.getClientIdIssuedAt());
assertNotNull(registerResponse.getClientSecretExpiresAt());

return registerResponse;
}

public AuthorizationResponse authorizationRequest(
final List<ResponseType> responseTypes, final ResponseMode responseMode, final ResponseMode expectedResponseMode,
Expand Down
Loading

0 comments on commit edab074

Please sign in to comment.