feature/Identitiy Proivider; Tweak usage of the bank specific logo from an OBP-API instance

This commit is contained in:
Marko Milić 2021-06-08 14:30:26 +02:00
parent 104a8b83cc
commit a38af247cf
9 changed files with 16 additions and 7 deletions

View File

@ -71,6 +71,8 @@ public class ConsentController {
@Value("${logo.bank.enabled:false}")
private String showBankLogo;
@Value("${logo.bank.url:#}")
private String bankLogoUrl;
@Value("${obp.base_url:#}")
private String obpBaseUrl;
@ -154,6 +156,7 @@ public class ConsentController {
model.addAttribute("consents", consents);
model.addAttribute("showBankLogo", showBankLogo);
model.addAttribute("obpBaseUrl", obpBaseUrl);
model.addAttribute("bankLogoUrl", bankLogoUrl);
return "accounts";
} catch (Exception unhandledException) {
@ -173,6 +176,7 @@ public class ConsentController {
try {
model.addAttribute("showBankLogo", showBankLogo);
model.addAttribute("obpBaseUrl", obpBaseUrl);
model.addAttribute("bankLogoUrl", bankLogoUrl);
HttpHeaders headers = buildDirectLoginHeader(session);
String consentId = (String) session.getAttribute("consent_id");
String authorizationId = (String) session.getAttribute("authorizationId");
@ -241,6 +245,7 @@ public class ConsentController {
try{
model.addAttribute("showBankLogo", showBankLogo);
model.addAttribute("obpBaseUrl", obpBaseUrl);
model.addAttribute("bankLogoUrl", bankLogoUrl);
if(StringUtils.isNotBlank(deny)) {
final RejectRequest rejectRequest = new RejectRequest().error("access_denied").errorDescription("The resource owner denied the request");
final CompletedRequest completedRequest = adminApi.rejectConsentRequest(consent_challenge, rejectRequest);

View File

@ -66,6 +66,8 @@ public class LoginController implements ServletContextAware {
@Value("${logo.bank.enabled:false}")
private String showBankLogo;
@Value("${logo.bank.url:#}")
private String bankLogoUrl;
/**
* initiate global variable
@ -85,6 +87,7 @@ public class LoginController implements ServletContextAware {
model.addAttribute("buttonHoverBackgroundColor", buttonHoverBackgroundColor);
model.addAttribute("showBankLogo", showBankLogo);
model.addAttribute("obpBaseUrl", obpBaseUrl);
model.addAttribute("bankLogoUrl", bankLogoUrl);
try {
LoginRequest loginRequest = hydraAdmin.getLoginRequest(login_challenge);

View File

@ -43,4 +43,5 @@ force_jws=BGv1.3
#show_unhandled_errors=false
### Show Bank Logo
#logo.bank.enabled=false
#logo.bank.enabled=false
#logo.bank.url=https://static.openbankproject.com/bank/img/bank-logo.png

View File

@ -17,7 +17,7 @@
<body>
<nav class="navbar navbar-light bg-light">
<a class="navbar-brand" th:href="@{${application.obp_url}}">
<img th:if="${showBankLogo == 'true'}" th:src="@{${obpBaseUrl} + '/media/images/logo.png'}" height="55" class="d-inline-block align-top" alt=""></img>
<img th:if="${showBankLogo == 'true'}" th:src="@{${bankLogoUrl}}" height="55" class="d-inline-block align-top" alt=""></img>
<img th:unless="${showBankLogo == 'true'}" th:src="@{/images/logo.png}" height="55" class="d-inline-block align-top" alt=""></img>
</a>
</nav>

View File

@ -18,7 +18,7 @@
<body>
<nav class="navbar navbar-light bg-light">
<a class="navbar-brand" th:href="@{${application.obp_url}}">
<img th:if="${showBankLogo == 'true'}" th:src="@{${obpBaseUrl} + '/media/images/logo.png'}" height="55" class="d-inline-block align-top" alt=""></img>
<img th:if="${showBankLogo == 'true'}" th:src="@{${bankLogoUrl}}" height="55" class="d-inline-block align-top" alt=""></img>
<img th:unless="${showBankLogo == 'true'}" th:src="@{/images/logo.png}" height="55" class="d-inline-block align-top" alt=""></img>
</a>
</nav>

View File

@ -17,7 +17,7 @@
<body>
<nav class="navbar navbar-light bg-light">
<a class="navbar-brand" th:href="@{${application.obp_url}}">
<img th:if="${showBankLogo == 'true'}" th:src="@{${obpBaseUrl} + '/media/images/logo.png'}" height="55" class="d-inline-block align-top" alt=""></img>
<img th:if="${showBankLogo == 'true'}" th:src="@{${bankLogoUrl}}" height="55" class="d-inline-block align-top" alt=""></img>
<img th:unless="${showBankLogo == 'true'}" th:src="@{/images/logo.png}" height="55" class="d-inline-block align-top" alt=""></img>
</a>
</nav>

View File

@ -18,7 +18,7 @@
<body>
<nav class="navbar navbar-light bg-light">
<a class="navbar-brand" th:href="@{${application.obp_url}}">
<img th:if="${showBankLogo == 'true'}" th:src="@{${obpBaseUrl} + '/media/images/logo.png'}" height="55" class="d-inline-block align-top" alt=""></img>
<img th:if="${showBankLogo == 'true'}" th:src="@{${bankLogoUrl}}" height="55" class="d-inline-block align-top" alt=""></img>
<img th:unless="${showBankLogo == 'true'}" th:src="@{/images/logo.png}" height="55" class="d-inline-block align-top" alt=""></img>
</a>
</nav>

View File

@ -21,7 +21,7 @@
<body>
<nav class="navbar navbar-light bg-light">
<a class="navbar-brand" th:href="@{${application.obp_url}}">
<img th:if="${showBankLogo == 'true'}" th:src="@{${obpBaseUrl} + '/media/images/logo.png'}" height="55" class="d-inline-block align-top" alt=""></img>
<img th:if="${showBankLogo == 'true'}" th:src="@{${bankLogoUrl}}" height="55" class="d-inline-block align-top" alt=""></img>
<img th:unless="${showBankLogo == 'true'}" th:src="@{/images/logo.png}" height="55" class="d-inline-block align-top" alt=""></img>
</a>
</nav>

View File

@ -18,7 +18,7 @@
<body>
<nav class="navbar navbar-light bg-light">
<a class="navbar-brand" th:href="@{${application.obp_url}}">
<img th:if="${showBankLogo == 'true'}" th:src="@{${obpBaseUrl} + '/media/images/logo.png'}" height="55" class="d-inline-block align-top" alt=""></img>
<img th:if="${showBankLogo == 'true'}" th:src="@{${bankLogoUrl}}" height="55" class="d-inline-block align-top" alt=""></img>
<img th:unless="${showBankLogo == 'true'}" th:src="@{/images/logo.png}" height="55" class="d-inline-block align-top" alt=""></img>
</a>
</nav>