Skip to content

Commit

Permalink
AUT-3895: Correct and improve IPV token call.
Browse files Browse the repository at this point in the history
The request for a token to access the result of a re-verification
should contain the original redirect_uri provided in the authorise
request.  We were providing the redirect_uri that belongs to orch
rather than the auth one.

This was causing the IPV token endpoint to not respond to requests. The
ReverificationResult lambda did not have any timeout configuration on
the token request and was hanging.  The frontend does have a timeout so
we were seeing a timeout error in the frontend.  The Nimbus library
httpRequest method defaults to not having a timeout for connect or read
so an over-ride has been added to timeout connections and reads if IPV
does not respond.
  • Loading branch information
andrew-moores committed Jan 16, 2025
1 parent bb97685 commit f9d5137
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ci/terraform/oidc/reverification-result.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ module "reverification_result" {
INTERNAl_SECTOR_URI = var.internal_sector_uri
REDIS_KEY = local.redis_key
IPV_AUDIENCE = var.ipv_audience
IPV_AUTHORISATION_CALLBACK_URI = var.ipv_authorisation_callback_uri
IPV_AUTHORISATION_CALLBACK_URI = var.ipv_auth_authorize_callback_uri
IPV_AUTHORISATION_CLIENT_ID = var.ipv_authorisation_client_id
ENVIRONMENT = var.environment
IPV_REVERIFICATION_REQUESTS_SIGNING_KEY_ALIAS = aws_kms_alias.ipv_reverification_request_signing_key_alias.arn
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@ public HTTPResponse toHTTPResponse() {
count++;
try {
var httpRequest = tokenRequest.toHTTPRequest();

LOG.info("Sending IPV token request to {}", httpRequest.getURI());

httpRequest.setConnectTimeout(1000);
httpRequest.setReadTimeout(60 * 1000);

var httpResponse = httpRequest.send();

tokenResponse = TokenResponse.parse(httpResponse);
Expand Down

0 comments on commit f9d5137

Please sign in to comment.