Skip to content

Commit 1ec6645

Browse files
committed
added claims gathering URI to "need_info" response
1 parent eba7f78 commit 1ec6645

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

uma-server/src/main/java/org/mitre/uma/web/UmaExceptionHandler.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,15 @@
2020
import java.util.HashMap;
2121
import java.util.Map;
2222

23+
import org.mitre.openid.connect.config.ConfigurationPropertiesBean;
2324
import org.mitre.openid.connect.view.HttpCodeView;
2425
import org.mitre.openid.connect.view.JsonEntityView;
2526
import org.mitre.openid.connect.view.JsonErrorView;
2627
import org.mitre.uma.exception.InvalidTicketException;
2728
import org.mitre.uma.exception.NeedInfoException;
2829
import org.mitre.uma.exception.NotAuthorizedException;
2930
import org.mitre.uma.model.Claim;
31+
import org.springframework.beans.factory.annotation.Autowired;
3032
import org.springframework.http.HttpStatus;
3133
import org.springframework.web.bind.annotation.ControllerAdvice;
3234
import org.springframework.web.bind.annotation.ExceptionHandler;
@@ -43,6 +45,9 @@
4345
@ControllerAdvice
4446
public class UmaExceptionHandler {
4547

48+
@Autowired
49+
private ConfigurationPropertiesBean config;
50+
4651
@ExceptionHandler(NeedInfoException.class)
4752
public ModelAndView handleUmaException(Exception e) {
4853
// if we got here, the claim didn't match, forward the user to the claim gathering endpoint
@@ -78,6 +83,7 @@ public ModelAndView handleUmaException(Exception e) {
7883
rpClaims.add("required_claims", req);
7984
details.add("requesting_party_claims", rpClaims);
8085
entity.add("error_details", details);
86+
entity.addProperty("claims_endpoint", config.getIssuer() + ClaimsCollectionEndpoint.URL);
8187

8288
Map<String, Object> m = new HashMap<>();
8389
m.put(JsonEntityView.ENTITY, entity);

0 commit comments

Comments
 (0)