Skip to content

Commit

Permalink
Fixed IDCS roles obtaining (#8207)
Browse files Browse the repository at this point in the history
Signed-off-by: David Kral <david.k.kral@oracle.com>
  • Loading branch information
Verdent committed Jan 8, 2024
1 parent cf47d4b commit afa735d
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021, 2023 Oracle and/or its affiliates.
* Copyright (c) 2021, 2024 Oracle and/or its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -160,7 +160,7 @@ protected List<? extends Grant> getGrantsFromServer(Subject subject) {

try {
List<? extends Grant> grants = appToken.getToken(tracing)
.map(appToken -> obtainGrantsFromServer(subjectName, subjectType, tracing))
.map(appToken -> obtainGrantsFromServer(subjectName, subjectType, appToken, tracing))
.orElseThrow(() -> new SecurityException("Application token not available"));

tracing.finish();
Expand All @@ -172,7 +172,10 @@ protected List<? extends Grant> getGrantsFromServer(Subject subject) {
}
}

private List<? extends Grant> obtainGrantsFromServer(String subjectName, String subjectType, RoleMapTracing tracing) {
private List<? extends Grant> obtainGrantsFromServer(String subjectName,
String subjectType,
String appToken,
RoleMapTracing tracing) {
JsonObjectBuilder requestBuilder = JSON.createObjectBuilder()
.add("mappingAttributeValue", subjectName)
.add("subjectType", subjectType)
Expand Down

0 comments on commit afa735d

Please sign in to comment.