Skip to content

Commit

Permalink
add log to UserInfoEndpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
andifalk committed Sep 8, 2021
1 parent 565832b commit 3fa4017
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,12 @@
import com.example.authorizationserver.token.store.model.OpaqueToken;
import com.nimbusds.jose.JOSEException;
import com.nimbusds.jwt.JWTClaimsSet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.MissingRequestHeaderException;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;

import java.text.ParseException;
import java.util.Optional;
Expand All @@ -27,6 +24,8 @@
@RestController
@RequestMapping(UserInfoEndpoint.ENDPOINT)
public class UserInfoEndpoint {
private static final Logger LOG =
LoggerFactory.getLogger(UserInfoEndpoint.class);

public static final String ENDPOINT = "/userinfo";

Expand All @@ -45,6 +44,9 @@ public UserInfoEndpoint(
public ResponseEntity<UserInfo> userInfo(
@RequestHeader("Authorization") String authorizationHeader) {
String tokenValue = AuthenticationUtil.fromBearerAuthHeader(authorizationHeader);

LOG.debug("Calling userinfo with bearer token header {}", tokenValue);

JsonWebToken jsonWebToken = tokenService.findJsonWebToken(tokenValue);
Optional<ScimUserEntity> user;
if (jsonWebToken != null) {
Expand Down

0 comments on commit 3fa4017

Please sign in to comment.