diff --git a/components/org.wso2.carbon.identity.api.server.dcr/pom.xml b/components/org.wso2.carbon.identity.api.server.dcr/pom.xml
index 2d07e59d8a4..117417ae74c 100644
--- a/components/org.wso2.carbon.identity.api.server.dcr/pom.xml
+++ b/components/org.wso2.carbon.identity.api.server.dcr/pom.xml
@@ -23,12 +23,12 @@
org.wso2.carbon.identity.inbound.auth.oauth2
identity-inbound-auth-oauth
- 7.0.178-SNAPSHOT
+ 7.0.173-SNAPSHOT
../../pom.xml
org.wso2.carbon.identity.api.server.dcr
- 7.0.178-SNAPSHOT
+ 7.0.173-SNAPSHOT
WSO2 Carbon - User DCR Rest API
WSO2 Carbon - User DCR Rest API
diff --git a/components/org.wso2.carbon.identity.api.server.oauth.scope/pom.xml b/components/org.wso2.carbon.identity.api.server.oauth.scope/pom.xml
index c1a9e37832b..72d2f71959f 100644
--- a/components/org.wso2.carbon.identity.api.server.oauth.scope/pom.xml
+++ b/components/org.wso2.carbon.identity.api.server.oauth.scope/pom.xml
@@ -23,12 +23,12 @@
org.wso2.carbon.identity.inbound.auth.oauth2
identity-inbound-auth-oauth
- 7.0.178-SNAPSHOT
+ 7.0.173-SNAPSHOT
../..
org.wso2.carbon.identity.api.server.oauth.scope
- 7.0.178-SNAPSHOT
+ 7.0.173-SNAPSHOT
WSO2 Carbon - Identity OAuth 2.0 Scope Rest APIs
Rest APIs for OAuth 2.0 Scope Handling
diff --git a/components/org.wso2.carbon.identity.client.attestation.filter/pom.xml b/components/org.wso2.carbon.identity.client.attestation.filter/pom.xml
index 1f54dc0f41e..9d04310e80a 100644
--- a/components/org.wso2.carbon.identity.client.attestation.filter/pom.xml
+++ b/components/org.wso2.carbon.identity.client.attestation.filter/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.identity.inbound.auth.oauth2
identity-inbound-auth-oauth
- 7.0.178-SNAPSHOT
+ 7.0.173-SNAPSHOT
../../pom.xml
diff --git a/components/org.wso2.carbon.identity.discovery/pom.xml b/components/org.wso2.carbon.identity.discovery/pom.xml
index 17608bac0e7..24697d85962 100644
--- a/components/org.wso2.carbon.identity.discovery/pom.xml
+++ b/components/org.wso2.carbon.identity.discovery/pom.xml
@@ -21,7 +21,7 @@
org.wso2.carbon.identity.inbound.auth.oauth2
identity-inbound-auth-oauth
../../pom.xml
- 7.0.178-SNAPSHOT
+ 7.0.173-SNAPSHOT
4.0.0
diff --git a/components/org.wso2.carbon.identity.oauth.ciba/pom.xml b/components/org.wso2.carbon.identity.oauth.ciba/pom.xml
index 0d4f0e98e4b..64e758372dc 100644
--- a/components/org.wso2.carbon.identity.oauth.ciba/pom.xml
+++ b/components/org.wso2.carbon.identity.oauth.ciba/pom.xml
@@ -20,7 +20,7 @@
identity-inbound-auth-oauth
org.wso2.carbon.identity.inbound.auth.oauth2
- 7.0.178-SNAPSHOT
+ 7.0.173-SNAPSHOT
../../pom.xml
diff --git a/components/org.wso2.carbon.identity.oauth.client.authn.filter/pom.xml b/components/org.wso2.carbon.identity.oauth.client.authn.filter/pom.xml
index 9bd489f57b3..3f2ac57623f 100644
--- a/components/org.wso2.carbon.identity.oauth.client.authn.filter/pom.xml
+++ b/components/org.wso2.carbon.identity.oauth.client.authn.filter/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.identity.inbound.auth.oauth2
identity-inbound-auth-oauth
../../pom.xml
- 7.0.178-SNAPSHOT
+ 7.0.173-SNAPSHOT
4.0.0
diff --git a/components/org.wso2.carbon.identity.oauth.common/pom.xml b/components/org.wso2.carbon.identity.oauth.common/pom.xml
index 965a5e120fc..1abfd544874 100644
--- a/components/org.wso2.carbon.identity.oauth.common/pom.xml
+++ b/components/org.wso2.carbon.identity.oauth.common/pom.xml
@@ -23,7 +23,7 @@
org.wso2.carbon.identity.inbound.auth.oauth2
identity-inbound-auth-oauth
../../pom.xml
- 7.0.178-SNAPSHOT
+ 7.0.173-SNAPSHOT
4.0.0
diff --git a/components/org.wso2.carbon.identity.oauth.common/src/main/java/org/wso2/carbon/identity/oauth/common/OAuthConstants.java b/components/org.wso2.carbon.identity.oauth.common/src/main/java/org/wso2/carbon/identity/oauth/common/OAuthConstants.java
index 7ee3e18fa16..2984f0bd82d 100644
--- a/components/org.wso2.carbon.identity.oauth.common/src/main/java/org/wso2/carbon/identity/oauth/common/OAuthConstants.java
+++ b/components/org.wso2.carbon.identity.oauth.common/src/main/java/org/wso2/carbon/identity/oauth/common/OAuthConstants.java
@@ -643,6 +643,8 @@ public static class OIDCConfigProperties {
public static final String IS_SUBJECT_TOKEN_ENABLED = "isSubjectTokenEnabled";
public static final String SUBJECT_TOKEN_EXPIRY_TIME = "subjectTokenExpiryTime";
public static final int SUBJECT_TOKEN_EXPIRY_TIME_VALUE = 180;
+ public static final String IS_ACCESS_TOKEN_CLAIMS_SEPARATION_ENABLED =
+ "isAccessTokenClaimsSeparationEnabled";
public static final String PREVENT_TOKEN_REUSE = "PreventTokenReuse";
public static final boolean DEFAULT_VALUE_FOR_PREVENT_TOKEN_REUSE = true;
// Name of the {@code JWTClientAuthenticatorConfig} resource type in the Configuration Management API.
diff --git a/components/org.wso2.carbon.identity.oauth.dcr.endpoint/pom.xml b/components/org.wso2.carbon.identity.oauth.dcr.endpoint/pom.xml
index fe0d9ea61ea..7bf68f87e07 100644
--- a/components/org.wso2.carbon.identity.oauth.dcr.endpoint/pom.xml
+++ b/components/org.wso2.carbon.identity.oauth.dcr.endpoint/pom.xml
@@ -6,7 +6,7 @@
org.wso2.carbon.identity.inbound.auth.oauth2
identity-inbound-auth-oauth
../../pom.xml
- 7.0.178-SNAPSHOT
+ 7.0.173-SNAPSHOT
4.0.0
diff --git a/components/org.wso2.carbon.identity.oauth.dcr/pom.xml b/components/org.wso2.carbon.identity.oauth.dcr/pom.xml
index 643d648ff31..aba3b0a37a8 100644
--- a/components/org.wso2.carbon.identity.oauth.dcr/pom.xml
+++ b/components/org.wso2.carbon.identity.oauth.dcr/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.identity.inbound.auth.oauth2
identity-inbound-auth-oauth
../../pom.xml
- 7.0.178-SNAPSHOT
+ 7.0.173-SNAPSHOT
4.0.0
diff --git a/components/org.wso2.carbon.identity.oauth.endpoint/pom.xml b/components/org.wso2.carbon.identity.oauth.endpoint/pom.xml
index 20222c87c3c..69e14b9b339 100644
--- a/components/org.wso2.carbon.identity.oauth.endpoint/pom.xml
+++ b/components/org.wso2.carbon.identity.oauth.endpoint/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.identity.inbound.auth.oauth2
identity-inbound-auth-oauth
../../pom.xml
- 7.0.178-SNAPSHOT
+ 7.0.173-SNAPSHOT
4.0.0
diff --git a/components/org.wso2.carbon.identity.oauth.endpoint/src/main/java/org/wso2/carbon/identity/oauth/endpoint/jwks/JwksEndpoint.java b/components/org.wso2.carbon.identity.oauth.endpoint/src/main/java/org/wso2/carbon/identity/oauth/endpoint/jwks/JwksEndpoint.java
index b193b1e2035..28e8d1f3ee6 100644
--- a/components/org.wso2.carbon.identity.oauth.endpoint/src/main/java/org/wso2/carbon/identity/oauth/endpoint/jwks/JwksEndpoint.java
+++ b/components/org.wso2.carbon.identity.oauth.endpoint/src/main/java/org/wso2/carbon/identity/oauth/endpoint/jwks/JwksEndpoint.java
@@ -30,15 +30,15 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.base.MultitenantConstants;
+import org.wso2.carbon.core.util.KeyStoreManager;
import org.wso2.carbon.identity.application.authentication.framework.util.FrameworkUtils;
-import org.wso2.carbon.identity.core.IdentityKeyStoreResolver;
-import org.wso2.carbon.identity.core.util.IdentityKeyStoreResolverConstants;
import org.wso2.carbon.identity.core.util.IdentityTenantUtil;
import org.wso2.carbon.identity.core.util.IdentityUtil;
import org.wso2.carbon.identity.oauth.common.OAuthConstants;
import org.wso2.carbon.identity.oauth.config.OAuthServerConfiguration;
import org.wso2.carbon.identity.oauth2.IdentityOAuth2Exception;
import org.wso2.carbon.identity.oauth2.util.OAuth2Util;
+import org.wso2.carbon.utils.security.KeystoreUtils;
import java.security.KeyStore;
import java.security.cert.Certificate;
@@ -79,22 +79,21 @@ public String jwks() {
try {
final KeyStore keystore;
-
+ List certificateInfoList = new ArrayList<>();
if (MultitenantConstants.SUPER_TENANT_DOMAIN_NAME.equalsIgnoreCase(tenantDomain)) {
- keystore = IdentityKeyStoreResolver.getInstance().getKeyStore(
- tenantDomain, IdentityKeyStoreResolverConstants.InboundProtocol.OAUTH);
+ KeyStoreManager keyStoreManager = KeyStoreManager.getInstance(MultitenantConstants.SUPER_TENANT_ID);
+ keystore = keyStoreManager.getPrimaryKeyStore();
} else {
try {
int tenantId = IdentityTenantUtil.getTenantId(tenantDomain);
IdentityTenantUtil.initializeRegistry(tenantId);
FrameworkUtils.startTenantFlow(tenantDomain);
- keystore = IdentityKeyStoreResolver.getInstance().getKeyStore(
- tenantDomain, IdentityKeyStoreResolverConstants.InboundProtocol.OAUTH);
+ KeyStoreManager keyStoreManager = KeyStoreManager.getInstance(tenantId);
+ keystore = keyStoreManager.getKeyStore(generateKSNameFromDomainName(tenantDomain));
} finally {
FrameworkUtils.endTenantFlow();
}
}
- List certificateInfoList = new ArrayList<>();
Enumeration enumeration = keystore.aliases();
while (enumeration.hasMoreElements()) {
String alias = (String) enumeration.nextElement();
@@ -251,6 +250,16 @@ private String logAndReturnError(String errorMesage, Exception e) {
return errorMesage;
}
+ /**
+ * This method generates the key store file name from the Domain Name.
+ *
+ * @return key store file name
+ */
+ private String generateKSNameFromDomainName(String tenantDomain) {
+
+ return KeystoreUtils.getKeyStoreFileLocation(tenantDomain);
+ }
+
/**
* This method generates the base64 encoded certificate list from a Certificate array.
*
diff --git a/components/org.wso2.carbon.identity.oauth.endpoint/src/test/java/org/wso2/carbon/identity/oauth/endpoint/jwks/JwksEndpointTest.java b/components/org.wso2.carbon.identity.oauth.endpoint/src/test/java/org/wso2/carbon/identity/oauth/endpoint/jwks/JwksEndpointTest.java
index 88fc33e620b..7eb38165df0 100644
--- a/components/org.wso2.carbon.identity.oauth.endpoint/src/test/java/org/wso2/carbon/identity/oauth/endpoint/jwks/JwksEndpointTest.java
+++ b/components/org.wso2.carbon.identity.oauth.endpoint/src/test/java/org/wso2/carbon/identity/oauth/endpoint/jwks/JwksEndpointTest.java
@@ -31,9 +31,9 @@
import org.testng.annotations.Test;
import org.wso2.carbon.base.CarbonBaseConstants;
import org.wso2.carbon.base.MultitenantConstants;
+import org.wso2.carbon.base.ServerConfiguration;
+import org.wso2.carbon.core.util.KeyStoreManager;
import org.wso2.carbon.identity.application.authentication.framework.util.FrameworkUtils;
-import org.wso2.carbon.identity.core.IdentityKeyStoreResolver;
-import org.wso2.carbon.identity.core.util.IdentityKeyStoreResolverConstants;
import org.wso2.carbon.identity.core.util.IdentityTenantUtil;
import org.wso2.carbon.identity.core.util.IdentityUtil;
import org.wso2.carbon.identity.oauth.common.OAuthConstants;
@@ -44,6 +44,7 @@
import org.wso2.carbon.identity.oauth2.keyidprovider.DefaultKeyIDProviderImpl;
import org.wso2.carbon.identity.oauth2.util.OAuth2Util;
import org.wso2.carbon.utils.CarbonUtils;
+import org.wso2.carbon.utils.security.KeystoreUtils;
import java.io.FileInputStream;
import java.lang.reflect.Field;
@@ -57,6 +58,7 @@
import java.util.Map;
import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.Mockito.lenient;
import static org.mockito.Mockito.mockStatic;
@@ -67,6 +69,9 @@
@Listeners(MockitoTestNGListener.class)
public class JwksEndpointTest {
+ @Mock
+ ServerConfiguration serverConfiguration;
+
@Mock
OAuthServerConfiguration mockOAuthServerConfiguration;
@@ -74,7 +79,7 @@ public class JwksEndpointTest {
TokenPersistenceProcessor tokenPersistenceProcessor;
@Mock
- IdentityKeyStoreResolver mockIdentityKeyStoreResolver;
+ KeyStoreManager mockKeyStoreManager;
private static final String CERT_THUMB_PRINT = "generatedCertThrumbPrint";
private static final String ALG = "RS256";
@@ -144,16 +149,22 @@ public void testJwks(String tenantDomain, int tenantId) throws Exception {
OAuthServerConfiguration.class);
MockedStatic carbonUtils = mockStatic(CarbonUtils.class);
MockedStatic identityTenantUtil = mockStatic(IdentityTenantUtil.class);
- MockedStatic frameworkUtils = mockStatic(FrameworkUtils.class);) {
+ MockedStatic frameworkUtils = mockStatic(FrameworkUtils.class);
+ MockedStatic keystoreUtils = mockStatic(KeystoreUtils.class);) {
+ Path keystorePath =
+ Paths.get(System.getProperty(CarbonBaseConstants.CARBON_HOME), "repository", "resources",
+ "security", "wso2carbon.jks");
+ keystoreUtils.when(() -> KeystoreUtils.getKeyStoreFileLocation("foo.com")).thenReturn("foo-com.jks");
mockOAuthServerConfiguration(oAuthServerConfiguration);
// When the OAuth2Util is mocked, OAuthServerConfiguration instance should be available.
try (MockedStatic oAuth2Util = mockStatic(OAuth2Util.class);
- MockedStatic identityKeyStoreResolver =
- mockStatic(IdentityKeyStoreResolver.class);
+ MockedStatic keyStoreManager = mockStatic(KeyStoreManager.class);
MockedStatic identityUtil = mockStatic(IdentityUtil.class)) {
+ carbonUtils.when(CarbonUtils::getServerConfiguration).thenReturn(serverConfiguration);
+
ThreadLocal