Skip to content

Commit 6186a0a

Browse files
Merge pull request #62 from gooddata/cbon-lx-858-jwt-debug
fix: JWT login success audit logging
2 parents 6c39d98 + 04b9322 commit 6186a0a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Diff for: gooddata-server-oauth2-autoconfigure/src/main/kotlin/BearerTokenReactiveAuthenticationManagerResolver.kt

+4-4
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ private class JwtAuthenticationManager(
125125
}
126126
recordAuditForJwtAuthenticationError(organization.id, ex, jwtToken)
127127
}
128-
.doOnNext { token ->
129-
logFinishedJwtAuthentication(organization.id, token)
128+
.flatMap { token ->
129+
logFinishedJwtAuthentication(organization.id, token).thenReturn(token)
130130
}
131131
}
132132
}
@@ -221,8 +221,8 @@ private class JwtAuthenticationManager(
221221

222222
private fun getJwkSet(organizationId: String): Mono<JWKSet> = client.getJwks(organizationId).map(::JWKSet)
223223

224-
private fun logFinishedJwtAuthentication(organizationId: String, token: Authentication) {
225-
client.getUserById(organizationId, token.name).map { user ->
224+
private fun logFinishedJwtAuthentication(organizationId: String, token: Authentication): Mono<Void> {
225+
return client.getUserById(organizationId, token.name).flatMap { user ->
226226
auditClient.recordLoginSuccess(
227227
orgId = organizationId,
228228
userId = user.id,

0 commit comments

Comments
 (0)