-
Notifications
You must be signed in to change notification settings - Fork 414
Add versioning support for pre-issue access token action and extend grant types #3000
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
Draft
Lashen1227
wants to merge
20
commits into
wso2-extensions:master
Choose a base branch
from
Lashen1227:feat/pre-issue-access-token-action-token-exchange
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
af28bed
implement pre-issue access token action versioning and token exchange…
Lashen1227 7ecfab2
Merge branch 'wso2-extensions:master' into feat/pre-issue-access-toke…
Lashen1227 737570f
refactor: improve log initialization formatting in PreIssueAccessToke…
Lashen1227 ed8cbb0
feat: add support for actor claim in access token generation
Lashen1227 e4579dc
feat: enhance user resolution for federated and local users in access…
Lashen1227 082f0cf
add pre-issue access token action v1 tests
Lashen1227 b90e490
fix: missing scopes in the request
Lashen1227 4a1d779
fix: update tenant handling for suborg logins
Lashen1227 80c6760
fix: use login tenant organization when building pre-issue access tok…
Lashen1227 33a32cd
feat: add unit tests for PreIssueAccessTokenRequestBuilderV2Test abd …
Lashen1227 4d60a27
feat: enhance handling of nested claims in access token processing
Lashen1227 08d96d3
test: improve formatting in PreIssueAccessTokenResponseProcessorTest
Lashen1227 88e2b10
feat: update action trigger evaluation for additional grant types in V2
Lashen1227 3b6bb18
feat: add support for SAML2 bearer grant type in pre issue access tok…
Lashen1227 644953a
fix: missing accessingOrganization in suborg to root org switch
Lashen1227 993a243
fix: enhance nested claim processing to handle array index paths
Lashen1227 ee822e2
feat: implement nested claim removal and addition of custom object su…
Lashen1227 b49f29e
feat: add CIBA grant type
Lashen1227 8058776
Merge branch 'master' into feat/pre-issue-access-token-action-token-e…
Lashen1227 a743cfa
fix: update copyright year
Lashen1227 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
...va/org/wso2/carbon/identity/oauth/action/constant/PreIssueAccessTokenActionConstants.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| /* | ||
| * Copyright (c) 2026, WSO2 LLC. (http://www.wso2.com). | ||
| * | ||
| * WSO2 LLC. licenses this file to you under the Apache License, | ||
| * Version 2.0 (the "License"); you may not use this file except | ||
| * in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, | ||
| * software distributed under the License is distributed on an | ||
| * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| * KIND, either express or implied. See the License for the | ||
| * specific language governing permissions and limitations | ||
| * under the License. | ||
| */ | ||
|
|
||
| package org.wso2.carbon.identity.oauth.action.constant; | ||
|
|
||
| /** | ||
| * Constants related to Pre Issue Access Token Action. | ||
| */ | ||
| public class PreIssueAccessTokenActionConstants { | ||
|
|
||
| public static final String ACTION_VERSION_V1 = "v1"; | ||
| public static final String ACTION_VERSION_V2 = "v2"; | ||
|
|
||
| private PreIssueAccessTokenActionConstants() { | ||
|
|
||
| } | ||
| } |
57 changes: 57 additions & 0 deletions
57
...o2/carbon/identity/oauth/action/execution/PreIssueAccessTokenActionVersioningHandler.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| /* | ||
| * Copyright (c) 2026, WSO2 LLC. (http://www.wso2.com). | ||
| * | ||
| * WSO2 LLC. licenses this file to you under the Apache License, | ||
| * Version 2.0 (the "License"); you may not use this file except | ||
| * in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, | ||
| * software distributed under the License is distributed on an | ||
| * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| * KIND, either express or implied. See the License for the | ||
| * specific language governing permissions and limitations | ||
| * under the License. | ||
| */ | ||
|
|
||
| package org.wso2.carbon.identity.oauth.action.execution; | ||
|
|
||
| import org.wso2.carbon.identity.action.execution.api.exception.ActionExecutionException; | ||
| import org.wso2.carbon.identity.action.execution.api.model.ActionExecutionRequestContext; | ||
| import org.wso2.carbon.identity.action.execution.api.model.ActionType; | ||
| import org.wso2.carbon.identity.action.execution.api.model.FlowContext; | ||
| import org.wso2.carbon.identity.action.execution.api.service.impl.DefaultActionVersioningHandler; | ||
| import org.wso2.carbon.identity.action.management.api.model.Action; | ||
| import org.wso2.carbon.identity.oauth.action.versioning.ActionTriggerEvaluatorFactory; | ||
| import org.wso2.carbon.identity.oauth.action.versioning.ActionTriggerEvaluatorForVersion; | ||
|
|
||
| /** | ||
| * Implementation of the Version handler for pre issue access token action. | ||
| */ | ||
| public class PreIssueAccessTokenActionVersioningHandler extends DefaultActionVersioningHandler { | ||
|
|
||
| ActionTriggerEvaluatorFactory factory = ActionTriggerEvaluatorFactory.getInstance(); | ||
|
|
||
| @Override | ||
| public ActionType getSupportedActionType() { | ||
|
|
||
| return ActionType.PRE_ISSUE_ACCESS_TOKEN; | ||
| } | ||
|
|
||
| @Override | ||
| public boolean canExecute(ActionExecutionRequestContext actionExecutionRequestContext, FlowContext flowContext) | ||
| throws ActionExecutionException { | ||
|
|
||
| Action action = actionExecutionRequestContext.getAction(); | ||
| ActionTriggerEvaluatorForVersion versionTriggerEvaluator = factory.getVersionTriggerEvaluator(action); | ||
|
|
||
| if (!versionTriggerEvaluator.isTriggerableForActionV2SupportedGrants( | ||
| actionExecutionRequestContext.getActionType(), action, flowContext)) { | ||
| return false; | ||
| } | ||
|
|
||
| return true; | ||
| } | ||
| } | ||
432 changes: 4 additions & 428 deletions
432
...va/org/wso2/carbon/identity/oauth/action/execution/PreIssueAccessTokenRequestBuilder.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
.../java/org/wso2/carbon/identity/oauth/action/versioning/ActionTriggerEvaluatorFactory.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| /* | ||
| * Copyright (c) 2026, WSO2 LLC. (http://www.wso2.com). | ||
| * | ||
| * WSO2 LLC. licenses this file to you under the Apache License, | ||
| * Version 2.0 (the "License"); you may not use this file except | ||
| * in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, | ||
| * software distributed under the License is distributed on an | ||
| * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| * KIND, either express or implied. See the License for the | ||
| * specific language governing permissions and limitations | ||
| * under the License. | ||
| */ | ||
|
|
||
| package org.wso2.carbon.identity.oauth.action.versioning; | ||
|
|
||
| import org.wso2.carbon.identity.action.execution.api.exception.ActionExecutionException; | ||
| import org.wso2.carbon.identity.action.management.api.model.Action; | ||
| import org.wso2.carbon.identity.oauth.action.constant.PreIssueAccessTokenActionConstants; | ||
| import org.wso2.carbon.identity.oauth.action.versioning.v2.ActionTriggerEvaluatorForVersionV2; | ||
|
|
||
| /** | ||
| * Factory class for getting the ActionVersioningHandler by Action version. | ||
| */ | ||
| public class ActionTriggerEvaluatorFactory { | ||
|
|
||
| private static final ActionTriggerEvaluatorFactory instance = new ActionTriggerEvaluatorFactory(); | ||
|
|
||
| public static ActionTriggerEvaluatorFactory getInstance() { | ||
|
|
||
| return instance; | ||
| } | ||
|
|
||
| public ActionTriggerEvaluatorForVersion getVersionTriggerEvaluator(Action action) | ||
| throws ActionExecutionException { | ||
|
|
||
| switch (action.getActionVersion()) { | ||
Lashen1227 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| case PreIssueAccessTokenActionConstants.ACTION_VERSION_V1: | ||
| return ActionTriggerEvaluatorForVersion.getInstance(); | ||
| case PreIssueAccessTokenActionConstants.ACTION_VERSION_V2: | ||
| return ActionTriggerEvaluatorForVersionV2.getInstance(); | ||
| default: | ||
| throw new ActionExecutionException("Unsupported action version: " + action.getActionVersion()); | ||
Lashen1227 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
| } | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.