Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V2 3 0 unclean #387

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions components/auth-proxy-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.wso2.carbon.identity</groupId>
<groupId>org.wso2.carbon.identity.framework</groupId>
<artifactId>org.wso2.carbon.identity.user.registration.stub</artifactId>
<scope>provided</scope>
</dependency>
Expand Down Expand Up @@ -96,7 +96,7 @@
<!--<version>2.0.4-SNAPSHOT</version>-->
<!--</dependency>-->
<dependency>
<groupId>org.wso2.carbon.identity</groupId>
<groupId>org.wso2.carbon.identity.framework</groupId>
<artifactId>org.wso2.carbon.identity.application.authentication.framework</artifactId>
<scope>provided</scope>
</dependency>
Expand Down
6 changes: 3 additions & 3 deletions components/authenticate-selector/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@
<dependencies>

<dependency>
<groupId>org.wso2.carbon.identity</groupId>
<groupId>org.wso2.carbon.identity.framework</groupId>
<artifactId>org.wso2.carbon.identity.application.common</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.carbon</groupId>
<artifactId>org.wso2.carbon.utils</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.carbon.identity</groupId>
<groupId>org.wso2.carbon.identity.framework</groupId>
<artifactId>org.wso2.carbon.identity.core</artifactId>
</dependency>
<dependency>
Expand Down Expand Up @@ -68,7 +68,7 @@

<Import-Package>
org.osgi.framework,
*;resolution:=optional
*;resolution:=optional
</Import-Package>
<Export-Package>com.wso2telco.*
</Export-Package>
Expand Down
4 changes: 2 additions & 2 deletions components/authentication-endpoint/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,12 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.wso2.carbon.identity</groupId>
<groupId>org.wso2.carbon.identity.framework</groupId>
<artifactId>org.wso2.carbon.identity.application.authentication.endpoint.util</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.wso2.carbon.identity</groupId>
<groupId>org.wso2.carbon.identity.framework</groupId>
<artifactId>org.wso2.carbon.identity.application.authentication.framework</artifactId>
<scope>provided</scope>
</dependency>
Expand Down
22 changes: 11 additions & 11 deletions components/gsma-authenticators/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@

<dependencies>
<dependency>
<groupId>org.wso2.carbon.identity</groupId>
<groupId>org.wso2.carbon.identity.inbound.auth.oauth2</groupId>
<artifactId>org.wso2.carbon.identity.oauth</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.carbon.identity</groupId>
<groupId>org.wso2.carbon.identity.framework</groupId>
<artifactId>org.wso2.carbon.identity.application.common</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.carbon.identity</groupId>
<groupId>org.wso2.carbon.identity.framework</groupId>
<artifactId>org.wso2.carbon.identity.application.authentication.framework</artifactId>
</dependency>
<dependency>
Expand Down Expand Up @@ -96,22 +96,22 @@
<artifactId>commons-logging</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.carbon.identity</groupId>
<groupId>org.wso2.carbon.identity.user.ws</groupId>
<artifactId>org.wso2.carbon.um.ws.api.stub</artifactId>
<type>jar</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.wso2.carbon.identity</groupId>
<groupId>org.wso2.carbon.identity.framework</groupId>
<artifactId>org.wso2.carbon.identity.application.authentication.endpoint.util</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.wso2.carbon.identity</groupId>
<artifactId>org.wso2.carbon.um.ws.api.stub</artifactId>
<type>jar</type>
<scope>provided</scope>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.wso2.carbon.identity.user.ws</groupId>-->
<!-- <artifactId>org.wso2.carbon.um.ws.api.stub</artifactId>-->
<!-- <type>jar</type>-->
<!-- <scope>provided</scope>-->
<!-- </dependency>-->
<dependency>
<groupId>com.wso2telco.core</groupId>
<artifactId>sp-config-util</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion components/ids-data-publisher/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
<version>${carbon.analytics.common.version}</version>
</dependency>
<dependency>
<groupId>org.wso2.carbon.identity</groupId>
<groupId>org.wso2.carbon.identity.framework</groupId>
<artifactId>org.wso2.carbon.identity.application.authentication.framework</artifactId>
</dependency>
<dependency>
Expand Down
8 changes: 4 additions & 4 deletions components/openid-token-builder/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@

<dependencies>
<dependency>
<groupId>org.wso2.carbon.identity</groupId>
<groupId>org.wso2.carbon.identity.inbound.auth.oauth2</groupId>
<artifactId>org.wso2.carbon.identity.oauth</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.carbon.identity</groupId>
<groupId>org.wso2.carbon.identity.framework</groupId>
<artifactId>org.wso2.carbon.identity.application.common</artifactId>
</dependency>
<!--<dependency>-->
Expand All @@ -51,7 +51,7 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.wso2.carbon.identity</groupId>
<groupId>org.wso2.carbon.identity.framework</groupId>
<artifactId>org.wso2.carbon.identity.application.authentication.framework</artifactId>
</dependency>
<dependency>
Expand All @@ -72,7 +72,7 @@
</dependency>

<dependency>
<groupId>org.wso2.carbon.identity</groupId>
<groupId>org.wso2.carbon.identity.framework</groupId>
<artifactId>org.wso2.carbon.identity.core</artifactId>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,24 @@
import org.json.JSONException;
import org.json.JSONObject;
import org.wso2.carbon.identity.application.common.model.ClaimMapping;
import org.wso2.carbon.identity.base.IdentityConstants;
import org.wso2.carbon.identity.base.IdentityException;
import org.wso2.carbon.identity.core.util.IdentityUtil;
import org.wso2.carbon.identity.oauth.cache.AuthorizationGrantCache;
import org.wso2.carbon.identity.oauth.cache.AuthorizationGrantCacheEntry;
import org.wso2.carbon.identity.oauth.cache.AuthorizationGrantCacheKey;
import org.wso2.carbon.identity.oauth.cache.OAuthCacheKey;
import org.wso2.carbon.identity.oauth2.IdentityOAuth2Exception;
import org.wso2.carbon.identity.oauth2.dao.OAuthTokenPersistenceFactory;
import org.wso2.carbon.identity.oauth2.dto.OAuth2AccessTokenRespDTO;
import org.wso2.carbon.identity.oauth2.model.AccessTokenDO;
import org.wso2.carbon.identity.oauth2.model.AuthzCodeDO;
import org.wso2.carbon.identity.oauth2.token.OAuthTokenReqMessageContext;
import org.wso2.carbon.identity.oauth2.token.handlers.grant.AuthorizationCodeGrantHandler;
import org.wso2.carbon.identity.oauth2.util.OAuth2Util;

import static org.wso2.carbon.identity.openidconnect.OIDCConstants.CODE_ID;

import java.io.*;
import java.nio.charset.StandardCharsets;
import java.util.*;
Expand Down Expand Up @@ -258,19 +265,30 @@ private OAuth2AccessTokenRespDTO provideAlreadyISIssedToken(FederatedIdpMappingD
+ tokReqMsgCtx.getOauth2AccessTokenReqDTO().getClientId() + " from database");
}

invalidateAuthCode(tokReqMsgCtx.getOauth2AccessTokenReqDTO().getAuthorizationCode(),
existingAccessTokenDO.getTokenId());
deactivateAuthzCode(tokReqMsgCtx, existingAccessTokenDO.getTokenId(),
tokReqMsgCtx.getOauth2AccessTokenReqDTO().getAuthorizationCode());
clearCacheForAuthCode(tokReqMsgCtx);
tokenRespDTO = prepareFromExistingToken(existingAccessTokenDO, tokReqMsgCtx);
return tokenRespDTO;
}

private void invalidateAuthCode(String authCode, String tokenId) throws IdentityOAuth2Exception {

this.tokenMgtDAO.deactivateAuthorizationCode(authCode, tokenId);

if (isdebug) {
log.debug(" Successfully deactivated the authcode used to generate access token, authCode : " + authCode);
private void deactivateAuthzCode(OAuthTokenReqMessageContext tokReqMsgCtx, String tokenId,
String authzCode) throws IdentityOAuth2Exception {
try {
// Here we deactivate the authorization and in the process update the tokenId against the authorization
// code so that we can correlate the current access token that is valid against the authorization code.
AuthzCodeDO authzCodeDO = new AuthzCodeDO();
authzCodeDO.setAuthorizationCode(authzCode);
authzCodeDO.setOauthTokenId(tokenId);
authzCodeDO.setAuthzCodeId(tokReqMsgCtx.getProperty(CODE_ID).toString());
OAuthTokenPersistenceFactory.getInstance().getAuthorizationCodeDAO()
.deactivateAuthorizationCode(authzCodeDO);
if (log.isDebugEnabled()
&& IdentityUtil.isTokenLoggable(IdentityConstants.IdentityTokens.AUTHORIZATION_CODE)) {
log.debug("Deactivated authorization code : " + authzCode);
}
} catch (IdentityException e) {
throw new IdentityOAuth2Exception("Error occurred while deactivating authorization code", e);
}
}

Expand Down
6 changes: 3 additions & 3 deletions components/session-updater/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.wso2.carbon.identity</groupId>
<groupId>org.wso2.carbon.identity.framework</groupId>
<artifactId>org.wso2.carbon.identity.mgt.stub</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.wso2.carbon.identity</groupId>
<groupId>org.wso2.carbon.identity.user.ws</groupId>
<artifactId>org.wso2.carbon.um.ws.api.stub</artifactId>
<scope>provided</scope>
</dependency>
Expand Down Expand Up @@ -87,7 +87,7 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.wso2.carbon.identity</groupId>
<groupId>org.wso2.carbon.identity.framework</groupId>
<artifactId>org.wso2.carbon.identity.application.authentication.framework</artifactId>
<scope>provided</scope>
</dependency>
Expand Down
2 changes: 1 addition & 1 deletion components/token-introspection/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.wso2.carbon.identity</groupId>
<groupId>org.wso2.carbon.identity.inbound.auth.oauth2</groupId>
<artifactId>org.wso2.carbon.identity.oauth</artifactId>
<scope>provided</scope>
<!--<scope>system</scope>-->
Expand Down
11 changes: 8 additions & 3 deletions components/user-claim-retriever/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.wso2.carbon.identity</groupId>
<groupId>org.wso2.carbon.identity.inbound.auth.oauth2</groupId>
<artifactId>org.wso2.carbon.identity.oauth</artifactId>
<scope>provided</scope>
</dependency>
Expand All @@ -55,7 +55,7 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.wso2.carbon.identity</groupId>
<groupId>org.wso2.carbon.identity.framework</groupId>
<artifactId>org.wso2.carbon.identity.application.authentication.framework</artifactId>
<scope>provided</scope>
</dependency>
Expand All @@ -82,8 +82,13 @@
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.carbon.identity.framework</groupId>
<artifactId>org.wso2.carbon.claim.mgt</artifactId>
<scope>provided</scope>
</dependency>

</dependencies>
</dependencies>

<build>
<plugins>
Expand Down
4 changes: 2 additions & 2 deletions components/user-registration/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.wso2.carbon.identity</groupId>
<groupId>org.wso2.carbon.identity.framework</groupId>
<artifactId>org.wso2.carbon.identity.user.registration.stub</artifactId>
<scope>provided</scope>
</dependency>
Expand Down Expand Up @@ -126,7 +126,7 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.wso2.carbon.identity</groupId>
<groupId>org.wso2.carbon.identity.framework</groupId>
<artifactId>org.wso2.carbon.identity.mgt.stub</artifactId>
<scope>provided</scope>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@
</adviceFile>
<bundles>
<bundleDef>com.wso2telco.core:mnc-resolver:${com.wso2telco.core.version}</bundleDef>
<bundleDef>org.wso2.carbon.identity:org.wso2.carbon.identity.core:${identity.framework.version}</bundleDef>
<bundleDef>org.wso2.carbon.identity.framework:org.wso2.carbon.identity.core:${identity.framework.version}</bundleDef>
<bundleDef>org.wso2.carbon:org.wso2.carbon.utils:${carbon.kernel.version}</bundleDef>
<bundleDef>org.wso2.carbon.identity:org.wso2.carbon.identity.application.common:${identity.framework.version}</bundleDef>
<bundleDef>org.wso2.carbon.identity.framework:org.wso2.carbon.identity.application.common:${identity.framework.version}</bundleDef>
<!--bundleDef>org.wso2.orbit.org.apache.httpcomponents:httpclient:${commons-httpclient.wso2.version}</bundleDef-->
<bundleDef>com.wso2telco.ids:authenticate-selector:${com.wso2telco.ids.version}</bundleDef>
</bundles>
Expand Down
4 changes: 2 additions & 2 deletions features/com.wso2telco.ids.saaserver.feature/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@
org.wso2.carbon:org.wso2.carbon.authenticator.stub:${carbon.kernel.version}
</bundleDef>
<bundleDef>
org.wso2.carbon.identity:org.wso2.carbon.identity.mgt.stub:${identity.framework.version}
org.wso2.carbon.identity.framework:org.wso2.carbon.identity.mgt.stub:${identity.framework.version}
</bundleDef>
<bundleDef>
org.wso2.carbon.identity:org.wso2.carbon.um.ws.api.stub:${identity.user.ws.version}
org.wso2.carbon.identity.user.ws:org.wso2.carbon.um.ws.api.stub:${identity.user.ws.version}
</bundleDef>
<bundleDef>
commons-codec.wso2:commons-codec:${commons-codec.version}
Expand Down
8 changes: 4 additions & 4 deletions features/com.wso2telco.ids.sessionupdater.ui.feature/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
<version>${carbon.kernel.version}</version>
</dependency>
<dependency>
<groupId>org.wso2.carbon.identity</groupId>
<groupId>org.wso2.carbon.identity.framework</groupId>
<artifactId>org.wso2.carbon.identity.mgt.stub</artifactId>
<version>${identity.framework.version}</version>
</dependency>
<dependency>
<groupId>org.wso2.carbon.identity</groupId>
<groupId>org.wso2.carbon.identity.user.ws</groupId>
<artifactId>org.wso2.carbon.um.ws.api.stub</artifactId>
<version>${identity.user.ws.version}</version>
</dependency>
Expand Down Expand Up @@ -147,10 +147,10 @@
org.wso2.carbon:org.wso2.carbon.authenticator.stub:${carbon.kernel.version}
</bundleDef>
<bundleDef>
org.wso2.carbon.identity:org.wso2.carbon.identity.mgt.stub:${identity.framework.version}
org.wso2.carbon.identity.framework:org.wso2.carbon.identity.mgt.stub:${identity.framework.version}
</bundleDef>
<bundleDef>
org.wso2.carbon.identity:org.wso2.carbon.um.ws.api.stub:${identity.user.ws.version}
org.wso2.carbon.identity.user.ws:org.wso2.carbon.um.ws.api.stub:${identity.user.ws.version}
</bundleDef>
<bundleDef>
commons-codec.wso2:commons-codec:${commons-codec.version}
Expand Down
Loading