From 0ef7de3bf5d915e8f1a1f242f4e583f433b993ad Mon Sep 17 00:00:00 2001 From: David Kral Date: Mon, 8 Jan 2024 09:54:27 +0100 Subject: [PATCH] Fixed IDCS roles obtaining Signed-off-by: David Kral --- .../providers/idcs/mapper/IdcsRoleMapperProvider.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/security/providers/idcs-mapper/src/main/java/io/helidon/security/providers/idcs/mapper/IdcsRoleMapperProvider.java b/security/providers/idcs-mapper/src/main/java/io/helidon/security/providers/idcs/mapper/IdcsRoleMapperProvider.java index d5682f51b06..e39a272753e 100644 --- a/security/providers/idcs-mapper/src/main/java/io/helidon/security/providers/idcs/mapper/IdcsRoleMapperProvider.java +++ b/security/providers/idcs-mapper/src/main/java/io/helidon/security/providers/idcs/mapper/IdcsRoleMapperProvider.java @@ -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. @@ -160,7 +160,7 @@ protected List getGrantsFromServer(Subject subject) { try { List 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(); @@ -172,7 +172,10 @@ protected List getGrantsFromServer(Subject subject) { } } - private List obtainGrantsFromServer(String subjectName, String subjectType, RoleMapTracing tracing) { + private List obtainGrantsFromServer(String subjectName, + String subjectType, + String appToken, + RoleMapTracing tracing) { JsonObjectBuilder requestBuilder = JSON.createObjectBuilder() .add("mappingAttributeValue", subjectName) .add("subjectType", subjectType)