Skip to content

Commit

Permalink
fix(authn): Print user info details when debugging is enabled (#362)
Browse files Browse the repository at this point in the history
  • Loading branch information
Travis Tomsu committed Mar 17, 2017
1 parent 72398e8 commit b8244fb
Showing 1 changed file with 5 additions and 0 deletions.
Expand Up @@ -16,6 +16,7 @@

package com.netflix.spinnaker.gate.security.oauth2

import com.fasterxml.jackson.databind.ObjectMapper
import com.netflix.spinnaker.gate.security.rolesprovider.UserRolesProvider
import com.netflix.spinnaker.gate.services.CredentialsService
import com.netflix.spinnaker.gate.services.PermissionService
Expand Down Expand Up @@ -70,6 +71,10 @@ class SpinnakerUserInfoTokenServices implements ResourceServerTokenServices {

Map details = oAuth2Authentication.userAuthentication.details as Map

if (log.isDebugEnabled()) {
log.debug("UserInfo details: " + new ObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(details))
}

if (!hasAllUserInfoRequirements(details)) {
throw new BadCredentialsException("User's info does not have all required fields.")
}
Expand Down

0 comments on commit b8244fb

Please sign in to comment.