@Test void updateAccessByConsentType_loginFailed() { assertThrows(AuthorizationException.class, () -> redirectConsentService.updateAccessByConsentType(getConsentWorkflow(AisConsentRequestType.DEDICATED_ACCOUNTS, IBAN_FR), Collections.singletonList(getAccountDetails()))); }
@Override public void updateAccessByConsentType(ConsentWorkflow workflow, List<AccountDetailsTO> listOfAccounts) { AisConsentRequestType consentType = workflow.getConsentResponse().getAccountConsent().getAisConsentRequestType(); if (!EnumSet.of(BANK_OFFERED, DEDICATED_ACCOUNTS).contains(consentType)) { AisAccountAccessInfoTO authAccountAccess = workflow.getAuthResponse().getConsent().getAccess(); List<String> ibans = extractUserIbans(listOfAccounts); authAccountAccess.setAccounts(ibans); if (ALL_AVAILABLE_ACCOUNTS == consentType && requestedConsentWithBalance(workflow)) { authAccountAccess.setBalances(ibans); } if (GLOBAL == consentType) { authAccountAccess.setBalances(ibans); authAccountAccess.setTransactions(ibans); } } if (DEDICATED_ACCOUNTS == consentType) { Set<String> ibans = new HashSet<>(extractUserIbans(listOfAccounts)); Set<String> ibansFromAccess = extractIbansFromAccess(workflow.getConsentResponse().getAccountConsent().getAccess()); checkAccess(ibansFromAccess, ibans); } }
RedirectConsentServiceImpl implements RedirectConsentService { @Override public void updateAccessByConsentType(ConsentWorkflow workflow, List<AccountDetailsTO> listOfAccounts) { AisConsentRequestType consentType = workflow.getConsentResponse().getAccountConsent().getAisConsentRequestType(); if (!EnumSet.of(BANK_OFFERED, DEDICATED_ACCOUNTS).contains(consentType)) { AisAccountAccessInfoTO authAccountAccess = workflow.getAuthResponse().getConsent().getAccess(); List<String> ibans = extractUserIbans(listOfAccounts); authAccountAccess.setAccounts(ibans); if (ALL_AVAILABLE_ACCOUNTS == consentType && requestedConsentWithBalance(workflow)) { authAccountAccess.setBalances(ibans); } if (GLOBAL == consentType) { authAccountAccess.setBalances(ibans); authAccountAccess.setTransactions(ibans); } } if (DEDICATED_ACCOUNTS == consentType) { Set<String> ibans = new HashSet<>(extractUserIbans(listOfAccounts)); Set<String> ibansFromAccess = extractIbansFromAccess(workflow.getConsentResponse().getAccountConsent().getAccess()); checkAccess(ibansFromAccess, ibans); } } }
RedirectConsentServiceImpl implements RedirectConsentService { @Override public void updateAccessByConsentType(ConsentWorkflow workflow, List<AccountDetailsTO> listOfAccounts) { AisConsentRequestType consentType = workflow.getConsentResponse().getAccountConsent().getAisConsentRequestType(); if (!EnumSet.of(BANK_OFFERED, DEDICATED_ACCOUNTS).contains(consentType)) { AisAccountAccessInfoTO authAccountAccess = workflow.getAuthResponse().getConsent().getAccess(); List<String> ibans = extractUserIbans(listOfAccounts); authAccountAccess.setAccounts(ibans); if (ALL_AVAILABLE_ACCOUNTS == consentType && requestedConsentWithBalance(workflow)) { authAccountAccess.setBalances(ibans); } if (GLOBAL == consentType) { authAccountAccess.setBalances(ibans); authAccountAccess.setTransactions(ibans); } } if (DEDICATED_ACCOUNTS == consentType) { Set<String> ibans = new HashSet<>(extractUserIbans(listOfAccounts)); Set<String> ibansFromAccess = extractIbansFromAccess(workflow.getConsentResponse().getAccountConsent().getAccess()); checkAccess(ibansFromAccess, ibans); } }  }
RedirectConsentServiceImpl implements RedirectConsentService { @Override public void updateAccessByConsentType(ConsentWorkflow workflow, List<AccountDetailsTO> listOfAccounts) { AisConsentRequestType consentType = workflow.getConsentResponse().getAccountConsent().getAisConsentRequestType(); if (!EnumSet.of(BANK_OFFERED, DEDICATED_ACCOUNTS).contains(consentType)) { AisAccountAccessInfoTO authAccountAccess = workflow.getAuthResponse().getConsent().getAccess(); List<String> ibans = extractUserIbans(listOfAccounts); authAccountAccess.setAccounts(ibans); if (ALL_AVAILABLE_ACCOUNTS == consentType && requestedConsentWithBalance(workflow)) { authAccountAccess.setBalances(ibans); } if (GLOBAL == consentType) { authAccountAccess.setBalances(ibans); authAccountAccess.setTransactions(ibans); } } if (DEDICATED_ACCOUNTS == consentType) { Set<String> ibans = new HashSet<>(extractUserIbans(listOfAccounts)); Set<String> ibansFromAccess = extractIbansFromAccess(workflow.getConsentResponse().getAccountConsent().getAccess()); checkAccess(ibansFromAccess, ibans); } }  @Override void selectScaMethod(String scaMethodId, final ConsentWorkflow workflow); @Override void updateAccessByConsentType(ConsentWorkflow workflow, List<AccountDetailsTO> listOfAccounts); @Override void updateScaStatusConsentStatusConsentData(String psuId, ConsentWorkflow workflow); @Override void startConsent(final ConsentWorkflow workflow, AisConsentTO aisConsent, List<AccountDetailsTO> listOfAccounts); @Override ConsentWorkflow identifyConsent(String encryptedConsentId, String authorizationId, boolean strict, String consentCookieString, BearerTokenTO bearerToken); }
RedirectConsentServiceImpl implements RedirectConsentService { @Override public void updateAccessByConsentType(ConsentWorkflow workflow, List<AccountDetailsTO> listOfAccounts) { AisConsentRequestType consentType = workflow.getConsentResponse().getAccountConsent().getAisConsentRequestType(); if (!EnumSet.of(BANK_OFFERED, DEDICATED_ACCOUNTS).contains(consentType)) { AisAccountAccessInfoTO authAccountAccess = workflow.getAuthResponse().getConsent().getAccess(); List<String> ibans = extractUserIbans(listOfAccounts); authAccountAccess.setAccounts(ibans); if (ALL_AVAILABLE_ACCOUNTS == consentType && requestedConsentWithBalance(workflow)) { authAccountAccess.setBalances(ibans); } if (GLOBAL == consentType) { authAccountAccess.setBalances(ibans); authAccountAccess.setTransactions(ibans); } } if (DEDICATED_ACCOUNTS == consentType) { Set<String> ibans = new HashSet<>(extractUserIbans(listOfAccounts)); Set<String> ibansFromAccess = extractIbansFromAccess(workflow.getConsentResponse().getAccountConsent().getAccess()); checkAccess(ibansFromAccess, ibans); } }  @Override void selectScaMethod(String scaMethodId, final ConsentWorkflow workflow); @Override void updateAccessByConsentType(ConsentWorkflow workflow, List<AccountDetailsTO> listOfAccounts); @Override void updateScaStatusConsentStatusConsentData(String psuId, ConsentWorkflow workflow); @Override void startConsent(final ConsentWorkflow workflow, AisConsentTO aisConsent, List<AccountDetailsTO> listOfAccounts); @Override ConsentWorkflow identifyConsent(String encryptedConsentId, String authorizationId, boolean strict, String consentCookieString, BearerTokenTO bearerToken);  }