|
20 | 20 | import java.util.HashMap; |
21 | 21 | import java.util.Map; |
22 | 22 |
|
| 23 | +import org.mitre.openid.connect.config.ConfigurationPropertiesBean; |
23 | 24 | import org.mitre.openid.connect.view.HttpCodeView; |
24 | 25 | import org.mitre.openid.connect.view.JsonEntityView; |
25 | 26 | import org.mitre.openid.connect.view.JsonErrorView; |
26 | 27 | import org.mitre.uma.exception.InvalidTicketException; |
27 | 28 | import org.mitre.uma.exception.NeedInfoException; |
28 | 29 | import org.mitre.uma.exception.NotAuthorizedException; |
29 | 30 | import org.mitre.uma.model.Claim; |
| 31 | +import org.springframework.beans.factory.annotation.Autowired; |
30 | 32 | import org.springframework.http.HttpStatus; |
31 | 33 | import org.springframework.web.bind.annotation.ControllerAdvice; |
32 | 34 | import org.springframework.web.bind.annotation.ExceptionHandler; |
|
43 | 45 | @ControllerAdvice |
44 | 46 | public class UmaExceptionHandler { |
45 | 47 |
|
| 48 | + @Autowired |
| 49 | + private ConfigurationPropertiesBean config; |
| 50 | + |
46 | 51 | @ExceptionHandler(NeedInfoException.class) |
47 | 52 | public ModelAndView handleUmaException(Exception e) { |
48 | 53 | // 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) { |
78 | 83 | rpClaims.add("required_claims", req); |
79 | 84 | details.add("requesting_party_claims", rpClaims); |
80 | 85 | entity.add("error_details", details); |
| 86 | + entity.addProperty("claims_endpoint", config.getIssuer() + ClaimsCollectionEndpoint.URL); |
81 | 87 |
|
82 | 88 | Map<String, Object> m = new HashMap<>(); |
83 | 89 | m.put(JsonEntityView.ENTITY, entity); |
|
0 commit comments