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

Default OAuth2 Scope Validator implementation #2206

Merged
Merged
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
0006d2a
add policy handlers
shashimalcse Oct 10, 2023
46756df
add new scope validtaor
shashimalcse Oct 12, 2023
fa30e13
add system scope handling
shashimalcse Oct 12, 2023
34473ae
filter role by apps
shashimalcse Oct 16, 2023
e04fcde
add user role resolving
shashimalcse Oct 19, 2023
0441a47
implement rbac
shashimalcse Oct 19, 2023
5832574
fix get user group and role ids list
shashimalcse Oct 19, 2023
a7aac52
fix getuser group
shashimalcse Oct 19, 2023
91e08be
fix null exception
shashimalcse Oct 20, 2023
ef401fe
introduce islegacyauthzruntime
shashimalcse Oct 21, 2023
01b9aa9
fix legacy app validator skip return
shashimalcse Oct 21, 2023
e1e097d
Merge branch 'master' into shashimalcse-patch-100
shashimalcse Oct 21, 2023
61125a7
fix formatting
shashimalcse Oct 21, 2023
392112b
fix xacml engagement
shashimalcse Oct 24, 2023
a0a1e66
Merge branch 'shashimalcse-patch-100' of https://github.com/shashimal…
shashimalcse Oct 24, 2023
c68a58d
fix user role resolver
shashimalcse Oct 24, 2023
7d590e9
remove registered scopes
shashimalcse Oct 24, 2023
e60d410
add authzutil class
shashimalcse Oct 24, 2023
1df3552
move legacy check to authzutil
shashimalcse Oct 24, 2023
3c1b5de
add licence headers
shashimalcse Oct 24, 2023
c697609
Merge branch 'master' into shashimalcse-patch-100
shashimalcse Oct 24, 2023
e9d52c8
fix for asub org user
shashimalcse Oct 24, 2023
22e54eb
fix conflict
shashimalcse Oct 24, 2023
213219c
fix kernel version
shashimalcse Oct 24, 2023
2f94647
fix compile issue wth fasterxml
shashimalcse Oct 25, 2023
02b537c
fix m2m can handle
shashimalcse Oct 25, 2023
24717fc
handle switch grant
shashimalcse Oct 25, 2023
d510014
fix xacml validator enagage
shashimalcse Oct 25, 2023
8c74de8
fix method name
shashimalcse Oct 25, 2023
ca66713
fix test failing
shashimalcse Oct 25, 2023
2e4ee32
remove SYSTEM scope from allowed scopes
shashimalcse Oct 25, 2023
b0c409a
Merge branch 'master' into shashimalcse-patch-100
shashimalcse Oct 25, 2023
b4e8417
fix console scopes issue
shashimalcse Oct 26, 2023
5f61cde
fix internal login scopes issue in client credentials
shashimalcse Oct 26, 2023
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
Prev Previous commit
fix internal login scopes issue in client credentials
shashimalcse committed Oct 26, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 5f61cdeb3504624f856299dfa187711a77966243
Original file line number Diff line number Diff line change
@@ -30,6 +30,7 @@
import org.wso2.carbon.identity.application.mgt.ApplicationManagementService;
import org.wso2.carbon.identity.oauth.IdentityOAuthAdminException;
import org.wso2.carbon.identity.oauth.OAuthAdminServiceImpl;
import org.wso2.carbon.identity.oauth.common.OAuthConstants;
import org.wso2.carbon.identity.oauth.internal.OAuthComponentServiceHolder;
import org.wso2.carbon.identity.oauth2.IdentityOAuth2Exception;
import org.wso2.carbon.identity.oauth2.authz.OAuthAuthzReqMessageContext;
@@ -50,6 +51,7 @@
import java.util.stream.Collectors;

import static org.wso2.carbon.identity.oauth2.Oauth2ScopeConstants.SYSTEM_SCOPE;
import static org.wso2.carbon.identity.oauth2.util.OAuth2Util.INTERNAL_LOGIN_SCOPE;

/**
* Default oauth2 scope validator which validate application authorized scopes.
@@ -112,6 +114,9 @@ public List<String> validateScope(OAuthTokenReqMessageContext tokenReqMessageCon
List<String> authorizedScopes = getAuthorizedScopes(requestedScopes, tokenReqMessageContext
.getAuthorizedUser(), appId, grantType, tenantDomain);
removeRegisteredScopes(tokenReqMessageContext);
if (OAuthConstants.GrantTypes.CLIENT_CREDENTIALS.equals(grantType) && authorizedScopes.contains(SYSTEM_SCOPE)) {
authorizedScopes.remove(INTERNAL_LOGIN_SCOPE);
}
return authorizedScopes;
}