token 발급시, 요청 파라미터 파일로깅 추가.
This commit is contained in:
@@ -241,6 +241,9 @@ public class AuthorizationServerConfig extends AuthorizationServerConfigurerAdap
|
||||
log.setRestrictionExemptYn(isRestrictionExempt ? "Y" : "N");
|
||||
log.setResultMessage(resultMessage);
|
||||
log.setAccessToken(accessToken); // Add access token value to the log
|
||||
|
||||
logger.info("Token request[/oauth/token or /oauth2/token] => clientId: {}, grantType: {}, scope: {}",
|
||||
clientId, data.getGrantType(), data.getScope());
|
||||
|
||||
tokenIssuanceLogDAO.saveTokenIssuanceLog(log);
|
||||
} catch (Throwable th) {
|
||||
|
||||
@@ -41,8 +41,14 @@ public class BearerTokenContoller {
|
||||
JSONObject resObject = new JSONObject();
|
||||
|
||||
try {
|
||||
String clientId = req.getFirst("client_id"); // .get("client_id");
|
||||
String clientId = req.getFirst("client_id");
|
||||
String grantType = req.getFirst("grant_type");
|
||||
String clientSecret = req.getFirst("client_secret");
|
||||
String scopes = req.getFirst("scope");
|
||||
|
||||
logger.info("Token request[/auth/oauth/v2/token] => clientId: {}, grantType: {}, scope: {}",
|
||||
clientId, grantType, scopes);
|
||||
|
||||
if (!StringUtils.equals(grantType, "client_credentials") ) {
|
||||
throw new JwtAuthException("unsupported_grant_type", "Unsupported grant type");
|
||||
}
|
||||
@@ -53,8 +59,10 @@ public class BearerTokenContoller {
|
||||
}
|
||||
|
||||
String tokenType = "Bearer";
|
||||
String clientSecret = req.getFirst("client_secret");
|
||||
String scopes = req.getFirst("scope");
|
||||
|
||||
|
||||
|
||||
|
||||
Long expiresIn = Long.valueOf(clientDetails.getAccessTokenValiditySeconds());
|
||||
|
||||
String[] reqScopeArr = org.springframework.util.StringUtils.tokenizeToStringArray(scopes, " ");
|
||||
|
||||
@@ -58,6 +58,7 @@ public class KjbMGOAuth2Controller {
|
||||
private static final String SERVICE_CODE_ACCESS_TOKEN = "00"; // 임시설정
|
||||
@Autowired
|
||||
private TokenIssuanceLogDAO tokenIssuanceLogDAO;
|
||||
|
||||
|
||||
@RequestMapping(value = "/mapi/oauth2/token", method = RequestMethod.POST, produces = "application/json; charset=\"UTF-8\"")
|
||||
@ResponseBody
|
||||
@@ -78,8 +79,12 @@ public class KjbMGOAuth2Controller {
|
||||
String grantType = tokenRequest.getGrantType();
|
||||
String clientId = tokenRequest.getClientId();
|
||||
String clientSecret = tokenRequest.getClientSecret();
|
||||
String scopes = tokenRequest.getScope();
|
||||
|
||||
logger.info("Token request[/mapi/oauth2/token] => clientId: {}, grantType: {}, scope: {}",
|
||||
clientId, grantType, scopes);
|
||||
|
||||
String[] scopeArr = org.springframework.util.StringUtils.tokenizeToStringArray(tokenRequest.getScope(), " ");
|
||||
String[] scopeArr = org.springframework.util.StringUtils.tokenizeToStringArray(scopes, " ");
|
||||
Set<String> scopeSet = new HashSet<String>();
|
||||
for (String scope : scopeArr) {
|
||||
scopeSet.add(scope);
|
||||
|
||||
Reference in New Issue
Block a user