Skip to content

Commit

Permalink
Lagt på logging III #deploy-profil-api
Browse files Browse the repository at this point in the history
  • Loading branch information
krharum committed Jan 21, 2025
1 parent 5ceddb0 commit a65d05f
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package no.nav.registre.testnorge.profil.service;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import no.nav.registre.testnorge.profil.consumer.AzureAdProfileConsumer;
import no.nav.registre.testnorge.profil.consumer.PersonOrganisasjonTilgangConsumer;
import no.nav.registre.testnorge.profil.domain.Profil;
Expand All @@ -12,7 +13,9 @@
import org.springframework.stereotype.Service;

import java.util.Optional;
import java.util.stream.Collectors;

@Slf4j
@Service
@RequiredArgsConstructor
public class ProfilService {
Expand Down Expand Up @@ -57,6 +60,13 @@ private JwtAuthenticationToken getJwtAuthenticationToken() {
return Optional.ofNullable(SecurityContextHolder.getContext().getAuthentication())
.filter(JwtAuthenticationToken.class::isInstance)
.map(JwtAuthenticationToken.class::cast)
.map(t -> {
log.info("JwtAuthenticationToken, attributes: {}",
t.getTokenAttributes().entrySet().stream()
.map(entry -> entry.getKey() + ":" + entry.getValue())
.collect(Collectors.joining(",")));
return t;
})
.orElseThrow();
}

Expand Down

0 comments on commit a65d05f

Please sign in to comment.