From: remillet Date: Sat, 16 Dec 2017 00:40:55 +0000 (-0800) Subject: DRYD-169: Password reset request now takes an XML payload rather than form data. X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=5161a88c3f3a2fd420f8408b596fcd99d1ed4ca2;p=tmp%2Fjakarta-migration.git DRYD-169: Password reset request now takes an XML payload rather than form data. --- diff --git a/services/account/service/src/main/java/org/collectionspace/services/account/AccountResource.java b/services/account/service/src/main/java/org/collectionspace/services/account/AccountResource.java index 8aaf5677e..38e678128 100644 --- a/services/account/service/src/main/java/org/collectionspace/services/account/AccountResource.java +++ b/services/account/service/src/main/java/org/collectionspace/services/account/AccountResource.java @@ -26,6 +26,7 @@ package org.collectionspace.services.account; import org.collectionspace.authentication.AuthN; import org.collectionspace.services.account.storage.AccountStorageClient; import org.collectionspace.services.account.storage.csidp.TokenStorageClient; +import org.collectionspace.services.authentication.Passwordreset; import org.collectionspace.services.authentication.Token; import org.collectionspace.services.authorization.AccountPermission; import org.collectionspace.services.authorization.AccountRole; @@ -234,10 +235,7 @@ public class AccountResource extends SecurityResourceBase { */ @POST @Path(PROCESS_PASSWORD_RESET_PATH) - @Consumes("application/x-www-form-urlencoded") - synchronized public Response processPasswordReset(@Context UriInfo ui, - @FormParam("token") String tokenId, - @FormParam("password") String base64EncodedPassword) throws UnsupportedEncodingException, DocumentNotFoundException { + synchronized public Response processPasswordReset(Passwordreset passwordreset, @Context UriInfo ui) throws UnsupportedEncodingException, DocumentNotFoundException { Response response = null; // @@ -249,12 +247,14 @@ public class AccountResource extends SecurityResourceBase { // // Get the 'token' and 'password' params // + String tokenId = passwordreset.getToken(); if (tokenId == null || tokenId.trim().isEmpty()) { response = Response.status(Response.Status.BAD_REQUEST).entity( "The query parameter 'token' is missing or contains no value.").type("text/plain").build(); return response; } + String base64EncodedPassword = passwordreset.getPassword(); if (base64EncodedPassword == null || base64EncodedPassword.trim().isEmpty()) { response = Response.status(Response.Status.BAD_REQUEST).entity( "The query parameter 'password' is missing or contains no value.").type("text/plain").build(); diff --git a/services/authentication/jaxb/src/main/resources/authentication_identity_provider.xsd b/services/authentication/jaxb/src/main/resources/authentication_identity_provider.xsd index d8e034719..3ead8c192 100644 --- a/services/authentication/jaxb/src/main/resources/authentication_identity_provider.xsd +++ b/services/authentication/jaxb/src/main/resources/authentication_identity_provider.xsd @@ -89,6 +89,24 @@ + + + + + + + + + + + The payload for a password reset request + + + + + + +