Skip to content

Commit

Permalink
fix(config-api): setting agama flow as auth method (#10539)
Browse files Browse the repository at this point in the history
* feat(config-api): default ACR methods issue#10511

Signed-off-by: pujavs <[email protected]>

* feat(config-api): agama flow acr method

* fix(config-api): setting agama flow as auth method

Signed-off-by: pujavs <[email protected]>

---------

Signed-off-by: pujavs <[email protected]>
  • Loading branch information
pujavs authored Jan 2, 2025
1 parent 3cd5d88 commit 3c00152
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 22 deletions.
22 changes: 12 additions & 10 deletions jans-config-api/docs/jans-config-api-swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9339,18 +9339,18 @@ components:
type: boolean
whitePagesCanView:
type: boolean
adminCanAccess:
type: boolean
userCanAccess:
type: boolean
adminCanView:
type: boolean
userCanView:
type: boolean
userCanEdit:
type: boolean
userCanAccess:
type: boolean
adminCanAccess:
type: boolean
adminCanEdit:
type: boolean
adminCanView:
type: boolean
baseDn:
type: string
PatchRequest:
Expand Down Expand Up @@ -10211,8 +10211,6 @@ components:
type: boolean
lockMessageConfig:
$ref: '#/components/schemas/LockMessageConfig'
fapi:
type: boolean
allResponseTypesSupported:
uniqueItems: true
type: array
Expand All @@ -10222,6 +10220,8 @@ components:
- code
- token
- id_token
fapi:
type: boolean
AuthenticationFilter:
required:
- baseDn
Expand Down Expand Up @@ -10988,10 +10988,10 @@ components:
type: array
items:
type: object
displayValue:
type: string
value:
type: object
displayValue:
type: string
LocalizedString:
type: object
properties:
Expand Down Expand Up @@ -11861,6 +11861,8 @@ components:
type: string
online_access:
type: boolean
authorization_challenge:
type: boolean
attributes:
type: object
additionalProperties:
Expand Down
4 changes: 2 additions & 2 deletions jans-config-api/plugins/docs/user-mgt-plugin-swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -863,10 +863,10 @@ components:
type: array
items:
type: object
displayValue:
type: string
value:
type: object
displayValue:
type: string
CustomUser:
type: object
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import io.swagger.v3.oas.annotations.security.*;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.Optional;
Expand Down Expand Up @@ -202,7 +204,7 @@ public boolean isValidAgamaDeployment(String authenticationMode) {
}
log.info(" agamaAcr:{},", agamaAcr);

if (keys != null && !keys.isEmpty() && keys.contains(agamaAcr)) {
if (!keys.isEmpty() && keys.contains(agamaAcr)) {
log.debug(" keys.contains(agamaAcr):{},", keys.contains(agamaAcr));
isValid = true;
}
Expand All @@ -213,24 +215,24 @@ public boolean isValidAgamaDeployment(String authenticationMode) {

private Set<String> getDirectLaunchFlows(List<Deployment> agamaDeploymentList) {
log.info(" agamaDeploymentList:{}", agamaDeploymentList);
Set<String> keys = null;
List<String> noDirectLaunchFlows = null;
Set<String> keys = new HashSet<>();
List<String> noDirectLaunchFlows = new ArrayList<>();
if (agamaDeploymentList == null || agamaDeploymentList.isEmpty()) {
return keys;
}
for (Deployment deployment : agamaDeploymentList) {
log.debug("Agama deployment:{},", deployment);
log.info("Agama deployment:{}, deployment.getId():{},", deployment, deployment.getId());
if (deployment.getDetails() != null && deployment.getDetails().getFlowsError() != null) {
keys = deployment.getDetails().getFlowsError().keySet();
log.debug(" Agama flow keys:{},", keys);
keys.addAll(deployment.getDetails().getFlowsError().keySet());
log.info("\n Agama flow keys:{},", keys);

if (deployment.getDetails().getProjectMetadata() != null) {
noDirectLaunchFlows = deployment.getDetails().getProjectMetadata().getNoDirectLaunchFlows();
if (deployment.getDetails().getProjectMetadata() != null && deployment.getDetails().getProjectMetadata().getNoDirectLaunchFlows()!=null) {
noDirectLaunchFlows.addAll(deployment.getDetails().getProjectMetadata().getNoDirectLaunchFlows());
}
}
}
log.debug("All deployed agama keys:{}, noDirectLaunchFlows:{}", keys, noDirectLaunchFlows);
if (keys != null && !keys.isEmpty() && noDirectLaunchFlows != null) {
log.info("\n All deployed agama keys:{}, noDirectLaunchFlows:{}", keys, noDirectLaunchFlows);
if (!keys.isEmpty() && !noDirectLaunchFlows.isEmpty()) {
keys.removeAll(noDirectLaunchFlows);
}
log.info("Final agama main flow keys:{}", keys);
Expand Down

0 comments on commit 3c00152

Please sign in to comment.