Skip to content

Commit

Permalink
ajust log debug
Browse files Browse the repository at this point in the history
  • Loading branch information
kr7ysztof committed Jul 25, 2023
1 parent 51c1609 commit 8204b83
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
11 changes: 5 additions & 6 deletions src/main/scala/com/ing/wbaa/rokku/sts/api/STSApi.scala
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,16 @@ trait STSApi extends LazyLogging with TokenXML {

private def parseDurationSeconds(aui: AuthenticationUserInfo, durationSeconds: Option[Int]): Duration = {
val maxTokenSession = if (aui.isNPA) stsSettings.maxTokenSessionForNPADuration else stsSettings.maxTokenSessionDuration
logger.debug("maxTokenSession {}", maxTokenSession)
val durationRequested = durationSeconds.map(ds => Duration(ds, TimeUnit.SECONDS))
val d = durationRequested match {
val durationResult = durationRequested match {
case None => stsSettings.defaultTokenSessionDuration
case Some(durationRequested) =>
if (durationRequested > maxTokenSession) maxTokenSession
else durationRequested
else durationRequested
}
logger.debug("stsSettings.maxTokenSessionForNPADuration {}", stsSettings.maxTokenSessionForNPADuration)
logger.debug("stsSettings.maxTokenSessionDuration {}", stsSettings.maxTokenSessionDuration)
logger.debug("durationRequested {}", durationRequested)
d
logger.debug("durationResult {}", durationResult)
durationResult
}

private def getSessionTokenInputs(aui: AuthenticationUserInfo) = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ trait KeycloakTokenVerifier extends LazyLogging {
* @return true if NPA
*/
private def isNPA(keycloakToken: AccessToken): Boolean = {
val isNPA = keycloakToken.getName == "NPA NPA"
logger.debug("user getName={}", keycloakToken.getName)
logger.debug("is NPA={}", keycloakToken.getName == "NPA NPA")
keycloakToken.getName == "NPA NPA"
logger.debug("is NPA={}", isNPA)
isNPA
}

protected[this] def verifyAuthenticationToken(token: BearerToken): Option[AuthenticationUserInfo] = Try {
Expand Down

0 comments on commit 8204b83

Please sign in to comment.