|
|
@ -20,10 +20,14 @@ package org.wso2.carbon.device.mgt.oauth.extensions.handlers.grant;
|
|
|
|
|
|
|
|
|
|
|
|
import org.apache.commons.logging.Log;
|
|
|
|
import org.apache.commons.logging.Log;
|
|
|
|
import org.apache.commons.logging.LogFactory;
|
|
|
|
import org.apache.commons.logging.LogFactory;
|
|
|
|
|
|
|
|
import org.wso2.carbon.apimgt.keymgt.ScopesIssuer;
|
|
|
|
|
|
|
|
import org.wso2.carbon.base.MultitenantConstants;
|
|
|
|
|
|
|
|
import org.wso2.carbon.identity.application.authentication.framework.model.AuthenticatedUser;
|
|
|
|
import org.wso2.carbon.identity.oauth2.IdentityOAuth2Exception;
|
|
|
|
import org.wso2.carbon.identity.oauth2.IdentityOAuth2Exception;
|
|
|
|
import org.wso2.carbon.identity.oauth2.grant.jwt.JWTBearerGrantHandler;
|
|
|
|
import org.wso2.carbon.identity.oauth2.grant.jwt.JWTBearerGrantHandler;
|
|
|
|
import org.wso2.carbon.identity.oauth2.model.RequestParameter;
|
|
|
|
import org.wso2.carbon.identity.oauth2.model.RequestParameter;
|
|
|
|
import org.wso2.carbon.identity.oauth2.token.OAuthTokenReqMessageContext;
|
|
|
|
import org.wso2.carbon.identity.oauth2.token.OAuthTokenReqMessageContext;
|
|
|
|
|
|
|
|
import org.wso2.carbon.utils.multitenancy.MultitenantUtils;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* This sets up user with tenant aware username.
|
|
|
|
* This sets up user with tenant aware username.
|
|
|
@ -34,8 +38,8 @@ public class ExtendedJWTGrantHandler extends JWTBearerGrantHandler {
|
|
|
|
private static final String TENANT_DOMAIN_KEY = "tenantDomain";
|
|
|
|
private static final String TENANT_DOMAIN_KEY = "tenantDomain";
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public boolean validateScope(OAuthTokenReqMessageContext tokReqMsgCtx) throws IdentityOAuth2Exception {
|
|
|
|
public boolean validateScope(OAuthTokenReqMessageContext tokReqMsgCtx) {
|
|
|
|
return super.validateScope(tokReqMsgCtx);
|
|
|
|
return ScopesIssuer.getInstance().setScopes(tokReqMsgCtx);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|