Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
kr7ysztof committed Jul 24, 2023
1 parent 76519f9 commit b557a86
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/scala/com/ing/wbaa/rokku/sts/api/STSApi.scala
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,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
val durationRequested = durationSeconds.map(ds => Duration(ds, TimeUnit.SECONDS))
durationRequested match {
val d = durationRequested match {
case None => stsSettings.defaultTokenSessionDuration
case Some(durationRequested) =>
if (durationRequested > maxTokenSession) maxTokenSession
else durationRequested
}
logger.info("stsSettings.maxTokenSessionForNPADuration {}", stsSettings.maxTokenSessionForNPADuration)
logger.info("stsSettings.maxTokenSessionDuration {}", stsSettings.maxTokenSessionDuration)
logger.info("durationRequested", durationRequested)
d
}

private def getSessionTokenInputs(aui: AuthenticationUserInfo) = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ trait KeycloakTokenVerifier extends LazyLogging {
import scala.jdk.CollectionConverters._

private def isNPA(keycloakToken: AccessToken): Boolean = {
logger.info("user getName={}", keycloakToken.getName)
logger.info("is NPA={}", keycloakToken.getName == "NPA NPA")
keycloakToken.getName == "NPA NPA"
}

Expand Down

0 comments on commit b557a86

Please sign in to comment.