Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(v4): merge v4.0.1 into preview #503

Merged
merged 91 commits into from
Oct 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
d174d59
Adding back the prod deployment blocker (#189)
kremi Aug 9, 2019
8731f7f
Merging branch 1.4.x into master
NikolaNaydenov Aug 20, 2019
f224037
extra tests for code quality (#196)
Aug 20, 2019
f94c0cc
Merge branch '1.4.x' of github.com:hmcts/idam-web-public
NikolaNaydenov Aug 20, 2019
e6d5ea4
Removing blocker for go live
NikolaNaydenov Aug 27, 2019
4bb7c16
Load vault secrets fix
NikolaNaydenov Aug 27, 2019
934d75e
Security fix
NikolaNaydenov Aug 27, 2019
aaa8965
Adding go live blocker
NikolaNaydenov Aug 28, 2019
91446c4
Securityscan master (#197)
dfourn Aug 28, 2019
ba52459
[PREVIEW] Fixing the pipeline (#211)
dfourn Sep 18, 2019
54cebfd
[PREVIEW] Minor content changes for 1.4.1 (#210)
dfourn Sep 18, 2019
a00aeb5
[PREVIEW] 1.4.1 Scope Change (#216) (#218)
nikola-naydenov-hmcts Sep 25, 2019
6a15b73
Add CVE-14540 and 16335 supressions
NikolaNaydenov Sep 25, 2019
f735457
Adding prod blocker
NikolaNaydenov Oct 1, 2019
2db2a6c
Disable functional tests
NikolaNaydenov Oct 1, 2019
a9db5c5
Web public tests 1.5 (#267)
shravanmechineni Nov 11, 2019
17d4778
feat(SIDM-3410-ips): filter out internal ips from policy valuation (#…
tbamido Nov 14, 2019
26e44e1
This should fix the ArrAffinity token problem (#277)
nikola-naydenov-hmcts Nov 20, 2019
390d5d6
feat(SIDM-3441-sso): Policy eval: remove bearer auth token (#283)
tbamido Nov 20, 2019
80c12ca
Include fix for 1.5 (#275)
nikola-naydenov-hmcts Nov 21, 2019
aed261e
feat(sidm-3410-rc2): merge 3410 preview into RC (#284)
tbamido Nov 21, 2019
b0eeb2e
feat(SIDM-3437-redir): login/mfa: redirecting using slash (#280) (#287)
tbamido Nov 21, 2019
27515dd
Mergin 1.5.RC
NikolaNaydenov Nov 29, 2019
16c2a31
Adding prod blocker
NikolaNaydenov Nov 29, 2019
5454a95
Duplicated code fix
NikolaNaydenov Nov 29, 2019
fcff4be
Enable functionals
NikolaNaydenov Dec 2, 2019
e1af002
Update contact us details. (#253)
dfourn Nov 6, 2019
f150aac
Removing prod blocker
NikolaNaydenov Dec 4, 2019
231e8f2
Merging 1.5.1.RC
NikolaNaydenov Jan 20, 2020
3741de9
Eliminating vulnerabilities
NikolaNaydenov Jan 30, 2020
86b0950
Removing blocker
NikolaNaydenov Jan 30, 2020
1ebdebd
Disable functionals
NikolaNaydenov Jan 30, 2020
e3b48fc
Merge branch 'master' into 2-0-0-rc1
kremi Mar 10, 2020
383f3fe
Adding support for multiple affinity cookies (#332)
nikola-naydenov-hmcts Mar 12, 2020
263106a
Apply suggestions from code review
henrydobson Mar 13, 2020
bea12c6
remove waits and add suggestions
Mar 13, 2020
6b00701
fix test failure
Mar 13, 2020
c8b5f6e
Merge branch '2-0-0-rc1' of github.com:hmcts/idam-web-public into 2-0…
Mar 13, 2020
f655528
add wait for failing tests
Mar 13, 2020
28cf6b8
ci(prod blocker): add
henrydobson Mar 13, 2020
8d8e3f1
fix hmcts policy set for block user test
Mar 13, 2020
ac3829d
Merge branch '2-0-0-rc1' of github.com:hmcts/idam-web-public into 2-0…
Mar 13, 2020
ba2c99f
fix(aat deployment): add credential and environment overrides
henrydobson Mar 14, 2020
b79a13c
2.0 RC (#330)
kremi Mar 14, 2020
0ca8d72
feat(chart): aat values
henrydobson Mar 23, 2020
19309ca
Merge remote-tracking branch 'origin/master' into 2-0-0-rc1
henrydobson Mar 23, 2020
0ba09e0
2.0.0 RC1 aat values (#336)
henrydobson Mar 23, 2020
dfd495c
Merge remote-tracking branch 'origin/master' into 2-0-0-rc1
henrydobson Mar 23, 2020
70bab50
fix(docker): flexvolume mapping to property
henrydobson Mar 23, 2020
38e0150
fix(idam-aat): add test variables (#338)
henrydobson Mar 26, 2020
3a5120a
SIDM-2868 - Add nightly tests for 2.0.0 (#341)
henrydobson Mar 26, 2020
9bac306
SIDM-3977 - v2 fix selfservice (#351)
henrydobson Apr 6, 2020
bb506f1
chore(idam-prod): remove prod blocker (#358)
henrydobson Apr 20, 2020
1a8c0ef
Zap Scanner exclusions
May 4, 2020
9108e45
excluding contact-us.* from zap scanner
May 6, 2020
c4c81c9
excluding login.* from zap scanner
May 6, 2020
ceea998
Ignoring some reverse proxy false positives
May 11, 2020
7c2b849
v2 rc1 (#375)
henrydobson Jun 9, 2020
72a500b
v2.1-rc2 (#379)
tbamido Jun 10, 2020
85355d3
V2 1 rc2 preview into master (#383)
tbamido Jun 10, 2020
391c72f
v2.1-rc2 preview into master (#387)
tbamido Jun 10, 2020
e2ef573
chore(cicd): remove prod blocker (#392)
henrydobson Jun 18, 2020
ef040e4
fix(aat): use common idam-api dependency (#393)
henrydobson Jun 18, 2020
7d78b4b
2.1 aat test urls (#394)
henrydobson Jun 18, 2020
d62f6a6
Set default response to HTML (#395)
nikola-naydenov-hmcts Jun 19, 2020
a7dabce
Extend media type list
Jun 19, 2020
53bc0cc
Update Jenkinsfile_CNP (#397)
henrydobson Jun 22, 2020
6484903
Master 2 2 from perf (#425)
tbamido Aug 4, 2020
c27e3ce
fix mfa role for authree changes (#426)
shravanmechineni Aug 4, 2020
9db8a67
chore(pitest): fix pitest gradle task (#428)
tbamido Aug 5, 2020
e24130a
2.2 to master (#431)
dfourn Aug 6, 2020
a36294d
revert(prod blocker): disable (#442)
henrydobson Aug 19, 2020
8fa63cf
increase unit test coverage of SPIService (#447)
dfourn Aug 19, 2020
9720d1d
chore(merge-4.0.0) prev ae131b6 into master (#461)
tbamido Aug 28, 2020
a2ec24d
chore(4.0-coverage) improve new code coverage (#463)
tbamido Aug 28, 2020
7fb0422
chore(v4-nightly): Fix nightly tests (#464)
tbamido Sep 1, 2020
e25cb66
Merge preview into master (#469)
tbamido Sep 1, 2020
76e7941
Merge v4 rc6 preview into master (#475)
tbamido Sep 2, 2020
7151ae8
Merge v4rc8 bce42cc preview into master (#477)
tbamido Sep 3, 2020
499e9c3
Merge v4rc9 preview into master (#480)
tbamido Sep 4, 2020
b13a6c6
V4.0.0 Final RC into Master (#493)
nikola-naydenov-hmcts Sep 18, 2020
096ec8d
chore(v4-merge): main.tf: remove redis to fix v4 merge #480 (#496)
tbamido Sep 21, 2020
25f5117
Do not lose OIDC params when going through SSO flow. (#499)
kremi Sep 28, 2020
b5d3128
Ignore prompt param when going through the SSO login flow. (#500)
kremi Sep 29, 2020
22cf607
While the SSO feature is running its pilot, we don't want all ejudici…
kremi Sep 30, 2020
e7cac5a
chore(SIDM-4785-rm-prod-blocker): remove prod blocker (#498)
tbamido Sep 30, 2020
d8e43fb
Use default domain name for session cookie
Oct 1, 2020
d21c47e
Security Vulnerabilities
Oct 1, 2020
b8eb016
Downgrade owasp for jenkins
Oct 1, 2020
a83a10d
feat(4.0.1): second-level SSO bugfix (#502)
henrydobson Oct 5, 2020
d85a23e
Merge branch 'master' @v4.0.1 into merge-v4.0.1-into-preview
tbamido Oct 5, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
repos:
- repo: git://github.com/antonbabenko/pre-commit-terraform
rev: v1.18.0
hooks:
- id: terraform_fmt
15 changes: 10 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ plugins {
id 'java'
id 'jacoco'
id 'io.spring.dependency-management' version '1.0.9.RELEASE' apply false
id 'org.owasp.dependencycheck' version '5.1.1'
id 'org.owasp.dependencycheck' version '5.3.2.1'
id 'org.sonarqube' version '2.6.2'
id 'org.springframework.boot' version '2.2.8.RELEASE' apply false
id 'org.springframework.boot' version '2.2.10.RELEASE' apply false
id 'com.gorylenko.gradle-git-properties' version '1.4.21'
id "info.solidsoft.pitest" version "1.4.6"
id 'pmd'
Expand Down Expand Up @@ -35,6 +35,7 @@ allprojects {
//TODO: Remove once spring boot have updated versions to match
ext['tomcat.version'] = '9.0.37'
ext['log4j2.version'] = '2.13.3'
ext['spring.boot.version'] = '2.2.10.RELEASE'

dependencyManagement {
imports {
Expand All @@ -59,6 +60,10 @@ allprojects {
analyzers {
// Disable scanning of .NET related binaries
assemblyEnabled = false
nodeEnabled = false
nodeAudit {
enabled = false
}
}
}

Expand All @@ -74,12 +79,12 @@ allprojects {
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-oauth2-client'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-oauth2-resource-server'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-data-redis-reactive'
implementation group: 'org.springframework.session', name: 'spring-session-data-redis', version: '2.2.3.RELEASE'
implementation group: 'org.springframework.session', name: 'spring-session-data-redis', version: '2.2.4.RELEASE'

implementation group: 'io.github.openfeign', name: 'feign-jackson', version: '10.11'
implementation group: 'io.github.openfeign', name: 'feign-okhttp', version: '10.11'
implementation group: 'org.springframework.cloud', name: 'spring-cloud-starter-openfeign', version: '2.2.3.RELEASE'
implementation(group: 'org.springframework.cloud', name: 'spring-cloud-starter-netflix-zuul', version: '2.2.3.RELEASE') {
implementation group: 'org.springframework.cloud', name: 'spring-cloud-starter-openfeign', version: '2.2.5.RELEASE'
implementation(group: 'org.springframework.cloud', name: 'spring-cloud-starter-netflix-zuul', version: '2.2.5.RELEASE') {
exclude(module: 'rxnetty-contexts')
exclude(module: 'rxnetty-servo')
exclude(module: 'rxnetty')
Expand Down
58 changes: 56 additions & 2 deletions dependency-check-suppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@
<cve>CVE-2014-0119</cve>
<cve>CVE-2016-5388</cve>
</suppress>

<!--
This vulnerability can only be exploited if polymorphic typing is enabled on the default
object mapper, hence not relevant to us.
Expand All @@ -214,7 +214,7 @@
ONLY UNTIL 2019-10-01. No invulnerable package currently
-->
<suppress>
<notes>
<notes>
https://www.cvedetails.com/cve/CVE-2019-12384/
FasterXML jackson-databind 2.x before 2.9.9.1 might allow attackers to have a variety of impacts by leveraging failure to block the logback-core class from polymorphic deserialization. Depending on the classpath content, remote code execution may be possible.
</notes>
Expand Down Expand Up @@ -280,6 +280,60 @@
<cve>CVE-2019-16370</cve>
</suppress>

<suppress>
<notes>
TODO: fix these: suppress some netflix CVEs to deploy a hotfix
</notes>
<gav regex="true">^com\.netflix\.servo:servo-core:0\.10\.1$</gav>
<cve>CVE-2014-0047</cve>
<cve>CVE-2014-0048</cve>
<cve>CVE-2014-5277</cve>
<cve>CVE-2014-5278</cve>
<cve>CVE-2014-5282</cve>
<cve>CVE-2014-6407</cve>
<cve>CVE-2014-8178</cve>
<cve>CVE-2014-8179</cve>
<cve>CVE-2014-9356</cve>
<cve>CVE-2014-9358</cve>
<cve>CVE-2015-3627</cve>
<cve>CVE-2015-3630</cve>
<cve>CVE-2015-3631</cve>
<cve>CVE-2016-3697</cve>
<cve>CVE-2017-14992</cve>
<cve>CVE-2019-13139</cve>
<cve>CVE-2019-13509</cve>
<cve>CVE-2019-15752</cve>
<cve>CVE-2019-16884</cve>
<cve>CVE-2019-5736</cve>
</suppress>

<suppress>
<notes>
TODO: fix these: suppress some netflix CVEs to deploy a hotfix
</notes>
<gav regex="true">^com\.netflix\.servo:servo-internal:0\.10\.1$</gav>
<cve>CVE-2014-0047</cve>
<cve>CVE-2014-0048</cve>
<cve>CVE-2014-5277</cve>
<cve>CVE-2014-5278</cve>
<cve>CVE-2014-5282</cve>
<cve>CVE-2014-6407</cve>
<cve>CVE-2014-8178</cve>
<cve>CVE-2014-8179</cve>
<cve>CVE-2014-9356</cve>
<cve>CVE-2014-9358</cve>
<cve>CVE-2015-3627</cve>
<cve>CVE-2015-3630</cve>
<cve>CVE-2015-3631</cve>
<cve>CVE-2016-3697</cve>
<cve>CVE-2017-14992</cve>
<cve>CVE-2019-13139</cve>
<cve>CVE-2019-13509</cve>
<cve>CVE-2019-15752</cve>
<cve>CVE-2019-16884</cve>
<cve>CVE-2019-5736</cve>
</suppress>

<!--
This dependency is a transitional dependency of spring-security-oauth2-client,
as such could only be exploited by developers.
Expand Down
53 changes: 31 additions & 22 deletions src/main/java/uk/gov/hmcts/reform/idam/web/AppController.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import org.springframework.web.client.HttpClientErrorException;
import org.springframework.web.client.HttpServerErrorException;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import org.springframework.web.servlet.view.RedirectView;
import uk.gov.hmcts.reform.idam.api.internal.model.ErrorResponse;
import uk.gov.hmcts.reform.idam.api.internal.model.Service;
Expand Down Expand Up @@ -74,6 +73,12 @@
@Controller
public class AppController {

private static final String REDIRECT_RESET_INACTIVE_USER = "redirect:/reset/inactive-user";
public static final String LOGIN_FAILURE_ERROR_CODE = "Login failure";
public static final String REDIRECT_PREFIX = "redirect:";
public static final String IDAM_AUTH_ID_COOKIE_PREFIX = "Idam.AuthId=";
public static final String ERROR_TITLE = "Error";

@Autowired
private SPIService spiService;

Expand Down Expand Up @@ -204,7 +209,7 @@ public ModelAndView upliftRegister(@ModelAttribute("registerUserCommand") @Valid
model.put("client_id", request.getClient_id());
model.put("redirect_uri", request.getRedirect_uri());
model.put("state", request.getState());
return new ModelAndView("redirect:/reset/inactive-user", model);
return new ModelAndView(REDIRECT_RESET_INACTIVE_USER, model);
}

msg = "PIN user not longer valid";
Expand Down Expand Up @@ -318,6 +323,8 @@ public String loginView(@ModelAttribute("authorizeCommand") AuthorizeRequest req

model.addAttribute(RESPONSE_TYPE, request.getResponse_type());
model.addAttribute(STATE, request.getState());
model.addAttribute(NONCE, request.getNonce());
model.addAttribute(PROMPT, request.getPrompt());
model.addAttribute(CLIENT_ID, request.getClient_id());
model.addAttribute(REDIRECT_URI, request.getRedirect_uri());
model.addAttribute(SCOPE, request.getScope());
Expand Down Expand Up @@ -387,7 +394,7 @@ public ModelAndView login(@ModelAttribute("authorizeCommand") @Validated Authori
if (cookies == null) {
log.info("/login: Authenticate returned no cookies for user - {}", obfuscateEmailAddress(request.getUsername()));
model.addAttribute(HAS_LOGIN_FAILED, true);
bindingResult.reject("Login failure");
bindingResult.reject(LOGIN_FAILURE_ERROR_CODE);
return new ModelAndView(LOGIN_VIEW, model.asMap());
}

Expand Down Expand Up @@ -416,11 +423,11 @@ public ModelAndView login(@ModelAttribute("authorizeCommand") @Validated Authori
log.info("/login: Successful login - {}", obfuscateEmailAddress(request.getUsername()));
List<String> secureCookies = authHelper.makeCookiesSecure(cookies);
secureCookies.forEach(cookie -> response.addHeader(HttpHeaders.SET_COOKIE, cookie));
return new ModelAndView("redirect:" + responseUrl);
return new ModelAndView(REDIRECT_PREFIX + responseUrl);
} else {
log.info("/login: There is a problem while logging in user - {}", obfuscateEmailAddress(request.getUsername()));
model.addAttribute(HAS_LOGIN_FAILED, true);
bindingResult.reject("Login failure");
bindingResult.reject(LOGIN_FAILURE_ERROR_CODE);
return new ModelAndView(LOGIN_VIEW, model.asMap());
}
}
Expand All @@ -430,9 +437,11 @@ public ModelAndView login(@ModelAttribute("authorizeCommand") @Validated Authori
case ACCOUNT_LOCKED:
model.addAttribute(IS_ACCOUNT_LOCKED, true);
bindingResult.reject("Account locked");
return new ModelAndView(LOGIN_VIEW, model.asMap());
case ACCOUNT_SUSPENDED:
model.addAttribute(IS_ACCOUNT_SUSPENDED, true);
bindingResult.reject("Account suspended");
return new ModelAndView(LOGIN_VIEW, model.asMap());
case POLICIES_FAIL:
log.info("/login: User failed policy checks - {}", obfuscateEmailAddress(request.getUsername()));
model.addAttribute(HAS_POLICY_CHECK_FAILED, true);
Expand All @@ -443,19 +452,19 @@ public ModelAndView login(@ModelAttribute("authorizeCommand") @Validated Authori
staleUserResetPasswordParams.remove(USERNAME);
staleUserResetPasswordParams.remove(PASSWORD);
staleUserResetPasswordParams.remove(SELF_REGISTRATION_ENABLED);
return new ModelAndView("redirect:/reset/inactive-user", staleUserResetPasswordParams);
return new ModelAndView(REDIRECT_RESET_INACTIVE_USER, staleUserResetPasswordParams);
default:
model.addAttribute(HAS_LOGIN_FAILED, true);
bindingResult.reject("Login failure");
bindingResult.reject(LOGIN_FAILURE_ERROR_CODE);
}
} else {
model.addAttribute(HAS_LOGIN_FAILED, true);
bindingResult.reject("Login failure");
bindingResult.reject(LOGIN_FAILURE_ERROR_CODE);
}
} catch (HttpClientErrorException | HttpServerErrorException | JsonProcessingException he) {
log.info("/login: Login failed for user - {}", obfuscateEmailAddress(request.getUsername()));
model.addAttribute(HAS_LOGIN_FAILED, true);
bindingResult.reject("Login failure");
bindingResult.reject(LOGIN_FAILURE_ERROR_CODE);
}
return new ModelAndView(LOGIN_VIEW, model.asMap());
}
Expand Down Expand Up @@ -555,10 +564,10 @@ public ModelAndView verification(@ModelAttribute("authorizeCommand") @Validated
try {
final String authId = StringUtils.substringAfter(
cookies.stream()
.filter(cookie -> cookie.startsWith("Idam.AuthId="))
.filter(cookie -> cookie.startsWith(IDAM_AUTH_ID_COOKIE_PREFIX))
.findFirst()
.orElseThrow(),
"Idam.AuthId=");
IDAM_AUTH_ID_COOKIE_PREFIX);
final List<String> responseCookies = spiService.submitOtpeAuthentication(authId, ipAddress, request.getCode());
log.info("/verification: Successful OTP submission request");

Expand All @@ -568,7 +577,7 @@ public ModelAndView verification(@ModelAttribute("authorizeCommand") @Validated
log.info("/verification: Successful login");
List<String> secureCookies = authHelper.makeCookiesSecure(responseCookies);
secureCookies.forEach(cookie -> response.addHeader(HttpHeaders.SET_COOKIE, cookie));
return new ModelAndView("redirect:" + responseUrl);
return new ModelAndView(REDIRECT_PREFIX + responseUrl);
} else {
log.info("/verification: There is a problem while logging in user");
return redirectToLoginOnFailedOtpVerification(request, bindingResult, model);
Expand All @@ -594,8 +603,8 @@ public ModelAndView verification(@ModelAttribute("authorizeCommand") @Validated
.get(HttpHeaders.SET_COOKIE))
.orElse(new ArrayList<>())
.stream()
.filter(cookie -> cookie.startsWith("Idam.AuthId="))
.map(cookie -> StringUtils.substringAfter(cookie, "Idam.AuthId="))
.filter(cookie -> cookie.startsWith(IDAM_AUTH_ID_COOKIE_PREFIX))
.map(cookie -> StringUtils.substringAfter(cookie, IDAM_AUTH_ID_COOKIE_PREFIX))
.findFirst()
.ifPresent(authId -> response.addCookie(new Cookie("Idam.AuthId", authId)));
return new ModelAndView(VERIFICATION_VIEW, model.asMap());
Expand All @@ -620,7 +629,7 @@ private ModelAndView redirectToLoginOnFailedOtpVerification(VerificationRequest
BindingResult bindingResult,
Model model) {
model.addAttribute("hasOtpCheckFailed", true);
bindingResult.reject("Login failure");
bindingResult.reject(LOGIN_FAILURE_ERROR_CODE);
model.addAttribute("authorizeCommand", request);
model.addAttribute(USERNAME, null);
return new ModelAndView("redirect:/" + LOGIN_VIEW, model.asMap());
Expand Down Expand Up @@ -651,7 +660,7 @@ public ModelAndView upliftLogin(@Validated UpliftRequest request, BindingResult
return new ModelAndView(UPLIFT_LOGIN_VIEW, modelMap);
}

String redirectUrl = "redirect:";
String redirectUrl = REDIRECT_PREFIX;
try {
final String jsonResponse = spiService.uplift(request.getUsername(), request.getPassword(), request.getJwt(),
request.getRedirect_uri(), request.getClient_id(), request.getState(), request.getScope());
Expand All @@ -666,7 +675,7 @@ public ModelAndView upliftLogin(@Validated UpliftRequest request, BindingResult
model.put("redirect_uri", request.getRedirect_uri());
model.put("state", request.getState());
model.put("scope", request.getScope());
return new ModelAndView("redirect:/reset/inactive-user", model);
return new ModelAndView(REDIRECT_RESET_INACTIVE_USER, model);
} else {
log.error("Uplift process exception: {}", ex.getMessage(), ex);

Expand Down Expand Up @@ -709,7 +718,7 @@ public String loginWithPin(@RequestParam(value = "pin", required = false) String

try {

return "redirect:" + spiService.loginWithPin(pin, redirectUri, state, clientId); //NOSONAR
return REDIRECT_PREFIX + spiService.loginWithPin(pin, redirectUri, state, clientId); //NOSONAR

} catch (HttpClientErrorException | BadCredentialsException e) {
log.error("Problem with pin: {}", e.getMessage());
Expand Down Expand Up @@ -797,14 +806,14 @@ public String resetPassword(final String action, final String password1, final S
} catch (HttpClientErrorException e) {
log.error("Error resetting password: {}", e.getResponseBodyAsString(), e);
if (e.getStatusCode() == HttpStatus.PRECONDITION_FAILED) {
ErrorHelper.showError("Error", "public.common.error.invalid.password", "public.common.error.invalid.password", "", model);
ErrorHelper.showError(ERROR_TITLE, "public.common.error.invalid.password", "public.common.error.invalid.password", "", model);
} else if (e.getStatusCode() == HttpStatus.BAD_REQUEST) {
if (validationService.isErrorInResponse(e.getResponseBodyAsString(), ErrorResponse.CodeEnum.PASSWORD_BLACKLISTED)) {
ErrorHelper.showError("Error", "public.common.error.blacklisted.password", "public.common.error.blacklisted.password", "public.common.error.enter.password", model);
ErrorHelper.showError(ERROR_TITLE, "public.common.error.blacklisted.password", "public.common.error.blacklisted.password", "public.common.error.enter.password", model);
} else if (validationService.isErrorInResponse(e.getResponseBodyAsString(), ErrorResponse.CodeEnum.PASSWORD_CONTAINS_PERSONAL_INFO)) {
ErrorHelper.showError("Error", "public.common.error.containspersonalinfo.password", "public.common.error.containspersonalinfo.password", "public.common.error.enter.password", model);
ErrorHelper.showError(ERROR_TITLE, "public.common.error.containspersonalinfo.password", "public.common.error.containspersonalinfo.password", "public.common.error.enter.password", model);
} else if (validationService.isErrorInResponse(e.getResponseBodyAsString(), ErrorResponse.CodeEnum.ACCOUNT_LOCKED)) {
ErrorHelper.showError("Error", "public.common.error.previously.used.password", "public.common.error.password.details", "public.common.error.enter.password", model);
ErrorHelper.showError(ERROR_TITLE, "public.common.error.previously.used.password", "public.common.error.password.details", "public.common.error.enter.password", model);
}
} else if (e.getStatusCode() == HttpStatus.NOT_FOUND) {
return "redirect:expiredtoken";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ protected void configure(HttpSecurity http) throws Exception {
// @formatter:on
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,13 @@ public Client client() {
Dispatcher dispatcher = new Dispatcher();
dispatcher.setMaxRequests(200);
dispatcher.setMaxRequestsPerHost(200);
OkHttpClient httpClient = new OkHttpClient.Builder()
OkHttpClient newHttpClient = new OkHttpClient.Builder()
.dispatcher(dispatcher)
.readTimeout(20000, TimeUnit.MILLISECONDS)
.followRedirects(false)
.followSslRedirects(false)
.build();
return new feign.okhttp.OkHttpClient(httpClient);
return new feign.okhttp.OkHttpClient(newHttpClient);
}

public Encoder feignFormEncoder() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import org.springframework.context.annotation.Configuration;
import org.springframework.http.CacheControl;
import org.springframework.http.MediaType;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.LocaleResolver;
import org.springframework.web.servlet.config.annotation.ContentNegotiationConfigurer;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public CookieSerializer cookieSerializer() {
DefaultCookieSerializer serializer = new DefaultCookieSerializer();
serializer.setCookieName("Idam.SSOSession");
serializer.setCookiePath("/");
serializer.setDomainNamePattern("^.+?\\.(\\w+\\.[a-z]+)$");
// serializer.setDomainNamePattern("^.+?\\.(\\w+\\.[a-z]+)$");
serializer.setCookieMaxAge(FIVE_DAYS_IN_SECONDS);
serializer.setUseSecureCookie(useSecureCookie);
return serializer;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package uk.gov.hmcts.reform.idam.web.helper;

import lombok.experimental.UtilityClass;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.web.client.HttpClientErrorException;
Expand All @@ -11,6 +12,7 @@

import static java.nio.charset.StandardCharsets.UTF_8;

@UtilityClass
public class ErrorHelper {

private static final String ERROR = "error";
Expand Down
Loading