From dda94437ee1a88f5328906606ea3da642c1c30f3 Mon Sep 17 00:00:00 2001 From: Kamidu Sachith Date: Thu, 28 Jan 2016 18:58:40 +0530 Subject: [PATCH] code clean up and refactoring --- .../oauth/validator/impl/ExternalOAuthValidator.java | 2 +- .../backend/oauth/validator/impl/LocalOAuthValidator.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/identity-extensions/backend-oauth-authenticator/src/main/java/org/wso2/carbon/identity/authenticator/backend/oauth/validator/impl/ExternalOAuthValidator.java b/components/identity-extensions/backend-oauth-authenticator/src/main/java/org/wso2/carbon/identity/authenticator/backend/oauth/validator/impl/ExternalOAuthValidator.java index 05f1579fa0..c3d246bb16 100755 --- a/components/identity-extensions/backend-oauth-authenticator/src/main/java/org/wso2/carbon/identity/authenticator/backend/oauth/validator/impl/ExternalOAuthValidator.java +++ b/components/identity-extensions/backend-oauth-authenticator/src/main/java/org/wso2/carbon/identity/authenticator/backend/oauth/validator/impl/ExternalOAuthValidator.java @@ -79,7 +79,7 @@ public class ExternalOAuthValidator implements OAuth2TokenValidator{ boolean isValid = tokenValidationResponse.getValid(); String userName = null; String tenantDomain = null; - if(isValid){ + if (isValid) { userName = MultitenantUtils.getTenantAwareUsername( tokenValidationResponse.getAuthorizedUser()); tenantDomain = MultitenantUtils. diff --git a/components/identity-extensions/backend-oauth-authenticator/src/main/java/org/wso2/carbon/identity/authenticator/backend/oauth/validator/impl/LocalOAuthValidator.java b/components/identity-extensions/backend-oauth-authenticator/src/main/java/org/wso2/carbon/identity/authenticator/backend/oauth/validator/impl/LocalOAuthValidator.java index 17243ed411..4182917f30 100755 --- a/components/identity-extensions/backend-oauth-authenticator/src/main/java/org/wso2/carbon/identity/authenticator/backend/oauth/validator/impl/LocalOAuthValidator.java +++ b/components/identity-extensions/backend-oauth-authenticator/src/main/java/org/wso2/carbon/identity/authenticator/backend/oauth/validator/impl/LocalOAuthValidator.java @@ -44,17 +44,17 @@ public class LocalOAuthValidator implements OAuth2TokenValidator { accessToken.setTokenType(OauthAuthenticatorConstants.BEARER_TOKEN_TYPE); accessToken.setIdentifier(token); validationRequest.setAccessToken(accessToken); - OAuth2TokenValidationResponseDTO tokenValidationResponse = OAuthAuthenticatorDataHolder.getInstance(). + OAuth2TokenValidationResponseDTO tokenValidationResponse = OAuthAuthenticatorDataHolder.getInstance(). getOAuth2TokenValidationService().findOAuthConsumerIfTokenIsValid(validationRequest).getAccessTokenValidationResponse(); boolean isValid = tokenValidationResponse.isValid(); String userName = null; String tenantDomain = null; - if(isValid){ + if (isValid) { userName = MultitenantUtils.getTenantAwareUsername( tokenValidationResponse.getAuthorizedUser()); tenantDomain = MultitenantUtils.getTenantDomain(tokenValidationResponse.getAuthorizedUser()); } - return new OAuthValidationResponse(userName,tenantDomain,isValid); + return new OAuthValidationResponse(userName, tenantDomain, isValid); } }