-
Notifications
You must be signed in to change notification settings - Fork 145
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
Allow sub organization applications to consume tokens from the valve level #302
Allow sub organization applications to consume tokens from the valve level #302
Conversation
@@ -174,7 +174,8 @@ protected AuthenticationResult doAuthenticate(MessageContext messageContext) { | |||
String serviceProviderName = null; | |||
String serviceProviderUUID = null; | |||
try { | |||
serviceProvider = OAuth2Util.getServiceProvider(oAuth2IntrospectionResponseDTO.getClientId()); | |||
serviceProvider = OAuth2Util.getServiceProvider(oAuth2IntrospectionResponseDTO.getClientId(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we check whether this can have impact on custom grant types where authorized user does not reside in application tenant domain. (May be we can try with a SaaS app first)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Modified the implementation
4aeaacf
to
ffce052
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #302 +/- ##
===========================================
- Coverage 3.66% 3.59% -0.08%
Complexity 20 20
===========================================
Files 36 36
Lines 1529 1559 +30
Branches 254 265 +11
===========================================
Hits 56 56
- Misses 1472 1502 +30
Partials 1 1 ☔ View full report in Codecov by Sentry. |
ffce052
to
15c716a
Compare
15c716a
to
bde18c2
Compare
if (StringUtils.equals(organizationID, ((AuthenticatedUser) user).getAccessingOrganization())) { | ||
return true; | ||
} else { | ||
OAuthAppDO oAuthAppDO = (OAuthAppDO) authenticationContext.getParameter( | ||
Constants.AUTH_CONTEXT_OAUTH_APP_PROPERTY); | ||
tenantDomain = OAuth2Util.getTenantDomainOfOauthApp(oAuthAppDO); | ||
return StringUtils.equals(((AuthenticatedUser) user).getAccessingOrganization(), tenantDomain); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At which point this code get executed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you are talking about the else part, that will be executed when a request comes from /t/{tenant-domain}/o/{org-id}
pattern.
...c/main/java/org/wso2/carbon/identity/auth/service/handler/impl/OAuth2AccessTokenHandler.java
Outdated
Show resolved
Hide resolved
create an issue to track unit test addition |
bde18c2
to
ed34989
Compare
PR builder started |
PR builder completed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving the pull request based on the successful pr build https://github.com/wso2/product-is/actions/runs/12975014116
Proposed changes in this pull request
/t/{tenant-domain}/o/{org-id}/
path to issue tokens.