code clean up and refactoring

revert-70aa11f8
Kamidu Sachith 9 years ago
parent 370badf9d3
commit dda94437ee

@ -79,7 +79,7 @@ public class ExternalOAuthValidator implements OAuth2TokenValidator{
boolean isValid = tokenValidationResponse.getValid(); boolean isValid = tokenValidationResponse.getValid();
String userName = null; String userName = null;
String tenantDomain = null; String tenantDomain = null;
if(isValid){ if (isValid) {
userName = MultitenantUtils.getTenantAwareUsername( userName = MultitenantUtils.getTenantAwareUsername(
tokenValidationResponse.getAuthorizedUser()); tokenValidationResponse.getAuthorizedUser());
tenantDomain = MultitenantUtils. tenantDomain = MultitenantUtils.

@ -44,17 +44,17 @@ public class LocalOAuthValidator implements OAuth2TokenValidator {
accessToken.setTokenType(OauthAuthenticatorConstants.BEARER_TOKEN_TYPE); accessToken.setTokenType(OauthAuthenticatorConstants.BEARER_TOKEN_TYPE);
accessToken.setIdentifier(token); accessToken.setIdentifier(token);
validationRequest.setAccessToken(accessToken); validationRequest.setAccessToken(accessToken);
OAuth2TokenValidationResponseDTO tokenValidationResponse = OAuthAuthenticatorDataHolder.getInstance(). OAuth2TokenValidationResponseDTO tokenValidationResponse = OAuthAuthenticatorDataHolder.getInstance().
getOAuth2TokenValidationService().findOAuthConsumerIfTokenIsValid(validationRequest).getAccessTokenValidationResponse(); getOAuth2TokenValidationService().findOAuthConsumerIfTokenIsValid(validationRequest).getAccessTokenValidationResponse();
boolean isValid = tokenValidationResponse.isValid(); boolean isValid = tokenValidationResponse.isValid();
String userName = null; String userName = null;
String tenantDomain = null; String tenantDomain = null;
if(isValid){ if (isValid) {
userName = MultitenantUtils.getTenantAwareUsername( userName = MultitenantUtils.getTenantAwareUsername(
tokenValidationResponse.getAuthorizedUser()); tokenValidationResponse.getAuthorizedUser());
tenantDomain = tenantDomain =
MultitenantUtils.getTenantDomain(tokenValidationResponse.getAuthorizedUser()); MultitenantUtils.getTenantDomain(tokenValidationResponse.getAuthorizedUser());
} }
return new OAuthValidationResponse(userName,tenantDomain,isValid); return new OAuthValidationResponse(userName, tenantDomain, isValid);
} }
} }

Loading…
Cancel
Save