File tree Expand file tree Collapse file tree
ext/oidcc4ui/logic/src/main/java/org/apache/syncope/core/logic Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3333import org .apache .syncope .core .persistence .api .dao .OIDCC4UIProviderDAO ;
3434import org .apache .syncope .core .persistence .api .entity .OIDCC4UIProvider ;
3535import org .apache .syncope .core .provisioning .api .data .OIDCC4UIProviderDataBinder ;
36+ import org .apache .syncope .core .spring .security .AuthContextUtils ;
3637import org .springframework .security .access .prepost .PreAuthorize ;
3738import org .springframework .transaction .annotation .Transactional ;
3839
@@ -89,7 +90,16 @@ public String create(final OIDCC4UIProviderTO opTO) {
8990 @ PreAuthorize ("isAuthenticated()" )
9091 @ Transactional (readOnly = true )
9192 public List <OIDCC4UIProviderTO > list () {
92- return opDAO .findAll ().stream ().map (binder ::getOIDCProviderTO ).toList ();
93+ boolean isAdmin = AuthContextUtils .getAuthorizations ().containsKey (OIDCC4UIEntitlement .OP_READ );
94+ return opDAO .findAll ().stream ().
95+ map (op -> {
96+ OIDCC4UIProviderTO opTO = binder .getOIDCProviderTO (op );
97+ if (!isAdmin ) {
98+ opTO .setClientSecret (null );
99+ }
100+ return opTO ;
101+ }).
102+ toList ();
93103 }
94104
95105 @ PreAuthorize ("hasRole('" + OIDCC4UIEntitlement .OP_READ + "')" )
You can’t perform that action at this time.
0 commit comments