Skip to content
Merged
Changes from all commits
Commits
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
6 changes: 5 additions & 1 deletion obp-api/src/main/scala/code/api/util/ConsentUtil.scala
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,11 @@ object Consent extends MdcLoggable {
if (!tppIsConsentHolder(c.mConsumerId.get, callContext)) { // Always check TPP first
val consentConsumerId = c.mConsumerId.get
val requestConsumerId = callContext.consumer.map(_.consumerId.get).getOrElse("NONE")
logger.info(s"ConsentNotFound: TPP/Consumer mismatch. Consent holder consumer_id=$consentConsumerId, Request consumer_id=$requestConsumerId, consent_id=${consent.jti}")
val consumerValidationMethodForConsent = APIUtil.getPropsValue("consumer_validation_method_for_consent").openOr("")
if(requestConsumerId == "NONE" || consumerValidationMethodForConsent.isEmpty) {
logger.warn(s"consumer_validation_method_for_consent is empty while request consumer_id=NONE - consent_id=${consent.jti}, aud=${consent.aud}")
}
logger.debug(s"ConsentNotFound: TPP/Consumer mismatch. Consent holder consumer_id=$consentConsumerId, Request consumer_id=$requestConsumerId, consent_id=${consent.jti}")
ErrorUtil.apiFailureToBox(ErrorMessages.ConsentNotFound, 401)(Some(callContext))
} else if (!verifyHmacSignedJwt(consentIdAsJwt, c)) { // verify signature
Failure(ErrorMessages.ConsentVerificationIssue)
Expand Down