Skip to content

Commit

Permalink
Error print
Browse files Browse the repository at this point in the history
  • Loading branch information
PascalLike committed Oct 12, 2024
1 parent 4016c91 commit 1e6a8b4
Showing 1 changed file with 17 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import javax.servlet.http.HttpServletRequestWrapper;

import static org.fao.geonet.kernel.security.openidconnect.GeonetworkClientRegistrationProvider.CLIENTREGISTRATION_NAME;

import java.util.Map;
/**
* This is to make things work well in Geonetwork.
* Spring's oauth allows for multiple oauth providers - and the /signin/... path would normally indicate which one
Expand Down Expand Up @@ -83,7 +83,14 @@ public String getParameter(String name) {
}
};
try {
return wrappedResolver.resolve(wrappedRequest, CLIENTREGISTRATION_NAME);
OAuth2AuthorizationRequest out = wrappedResolver.resolve(wrappedRequest, CLIENTREGISTRATION_NAME);
System.out.printf("DEBUG HOME MADE clientid %s!", out.getClientId());
for (Map.Entry<String, Object> entry : out.getAttributes().entrySet()) {
String key = entry.getKey();
Object value = entry.getValue();
System.out.println("DEBUG HOME MADE Key: " + key + ", Value: " + (value != null ? value.toString() : "null"));
}
return out;
} catch (Exception e) {
e.printStackTrace();
throw e;
Expand All @@ -109,7 +116,14 @@ public String getParameter(String name) {
}
};
try {
return wrappedResolver.resolve(wrappedRequest, CLIENTREGISTRATION_NAME);
OAuth2AuthorizationRequest out = wrappedResolver.resolve(wrappedRequest, CLIENTREGISTRATION_NAME);
System.out.printf("DEBUG HOME MADE clientid %s!", out.getClientId());
for (Map.Entry<String, Object> entry : out.getAttributes().entrySet()) {
String key = entry.getKey();
Object value = entry.getValue();
System.out.println("DEBUG HOME MADE Key: " + key + ", Value: " + (value != null ? value.toString() : "null"));
}
return out;
} catch (Exception e) {
e.printStackTrace();
throw e;
Expand Down

0 comments on commit 1e6a8b4

Please sign in to comment.