|
41 | 41 | import static org.privacyidea.PIConstants.ENDPOINT_TOKEN_INIT; |
42 | 42 | import static org.privacyidea.PIConstants.ENDPOINT_TRIGGERCHALLENGE; |
43 | 43 | import static org.privacyidea.PIConstants.ENDPOINT_VALIDATE_CHECK; |
| 44 | +import static org.privacyidea.PIConstants.CANCEL_ENROLLMENT; |
44 | 45 | import static org.privacyidea.PIConstants.ENDPOINT_VALIDATE_INITIALIZE; |
45 | 46 | import static org.privacyidea.PIConstants.GENKEY; |
46 | 47 | import static org.privacyidea.PIConstants.GET; |
@@ -373,6 +374,32 @@ public ChallengeStatus pollTransaction(String transactionID) |
373 | 374 | return piresponse.challengeStatus; |
374 | 375 | } |
375 | 376 |
|
| 377 | + /** |
| 378 | + * @see PrivacyIDEA#validateCheckCancelEnrollment(String, Map) |
| 379 | + */ |
| 380 | + public PIResponse validateCheckCancelEnrollment(String transactionID) |
| 381 | + { |
| 382 | + return this.validateCheckCancelEnrollment(transactionID, Collections.emptyMap()); |
| 383 | + } |
| 384 | + |
| 385 | + /** |
| 386 | + * Cancel enrollment via multichallenge. |
| 387 | + * |
| 388 | + * @param transactionID transaction ID |
| 389 | + * @param headers optional headers for the request |
| 390 | + * @return PIResponse or null if error |
| 391 | + */ |
| 392 | + public PIResponse validateCheckCancelEnrollment(String transactionID, Map<String, String> headers) |
| 393 | + { |
| 394 | + Map<String, String> params = new LinkedHashMap<>(); |
| 395 | + params.put(TRANSACTION_ID, transactionID); |
| 396 | + params.put(CANCEL_ENROLLMENT, "true"); |
| 397 | + appendRealm(params); |
| 398 | + |
| 399 | + String response = runRequestAsync(ENDPOINT_VALIDATE_CHECK, params, headers, false, POST); |
| 400 | + return this.parser.parsePIResponse(response); |
| 401 | + } |
| 402 | + |
376 | 403 | /** |
377 | 404 | * Get the service account parameters. |
378 | 405 | * |
|
0 commit comments