|
32 | 32 | import javax.servlet.http.HttpServletRequest; |
33 | 33 | import javax.servlet.http.HttpServletResponse; |
34 | 34 |
|
| 35 | +import org.apache.commons.httpclient.HttpStatus; |
35 | 36 | import org.apache.commons.logging.Log; |
36 | 37 | import org.apache.commons.logging.LogFactory; |
37 | 38 | import org.codehaus.jackson.map.ObjectMapper; |
38 | 39 | import org.codehaus.jackson.map.ObjectWriter; |
39 | 40 | import org.imsglobal.basiclti.BasicLTIConstants; |
40 | 41 | import org.imsglobal.basiclti.BasicLTIUtil; |
| 42 | +import org.imsglobal.basiclti.LtiVerificationResult; |
41 | 43 | import org.imsglobal.json.IMSJSONRequest; |
42 | 44 | import org.imsglobal.lti2.objects.Service_offered; |
43 | 45 | import org.imsglobal.lti2.objects.StandardServices; |
@@ -546,10 +548,10 @@ public void handleSettingsRequest(HttpServletRequest request,HttpServletResponse |
546 | 548 | String oauth_secret = (String) security_contract.get(LTI2Constants.SHARED_SECRET); |
547 | 549 |
|
548 | 550 | // Validate the incoming message |
549 | | - Object retval = BasicLTIUtil.validateMessage(request, URL, oauth_secret); |
550 | | - if ( retval instanceof String ) { |
551 | | - response.setStatus(HttpServletResponse.SC_FORBIDDEN); |
552 | | - doErrorJSON(request,response, jsonRequest, (String) retval, null); |
| 551 | + LtiVerificationResult result = BasicLTIUtil.validateMessage(request, URL, oauth_secret); |
| 552 | + if (!result.getSuccess()) { |
| 553 | + response.setStatus(HttpStatus.SC_FORBIDDEN); |
| 554 | + doErrorJSON(request,response, jsonRequest, result.getMessage(), null); |
553 | 555 | return; |
554 | 556 | } |
555 | 557 |
|
|
0 commit comments