diff --git a/components/org.wso2.carbon.identity.auth.service/src/main/java/org/wso2/carbon/identity/auth/service/handler/impl/OAuth2AccessTokenHandler.java b/components/org.wso2.carbon.identity.auth.service/src/main/java/org/wso2/carbon/identity/auth/service/handler/impl/OAuth2AccessTokenHandler.java index 920a5ce7..d6a15e40 100644 --- a/components/org.wso2.carbon.identity.auth.service/src/main/java/org/wso2/carbon/identity/auth/service/handler/impl/OAuth2AccessTokenHandler.java +++ b/components/org.wso2.carbon.identity.auth.service/src/main/java/org/wso2/carbon/identity/auth/service/handler/impl/OAuth2AccessTokenHandler.java @@ -204,16 +204,15 @@ protected AuthenticationResult doAuthenticate(MessageContext messageContext) { if (serviceProviderName != null){ authenticationContext.addParameter(SERVICE_PROVIDER_NAME, serviceProviderName); + MDC.put(SERVICE_PROVIDER_NAME, serviceProviderName); } if (serviceProviderTenantDomain != null) { authenticationContext.addParameter(SERVICE_PROVIDER_TENANT_DOMAIN, serviceProviderTenantDomain); } if (serviceProviderUUID != null) { authenticationContext.addParameter(SERVICE_PROVIDER_UUID, serviceProviderUUID); + MDC.put(SERVICE_PROVIDER_UUID, serviceProviderUUID); } - - MDC.put(SERVICE_PROVIDER_NAME, serviceProviderName); - MDC.put(SERVICE_PROVIDER_UUID, serviceProviderUUID); // Set OAuth service provider details to be consumed by the provisioning framework. setProvisioningServiceProviderThreadLocal(oAuth2IntrospectionResponseDTO.getClientId(), serviceProviderTenantDomain);