2017-03-02 1 views
0

Ich benutze Drupal 8.3.x.Update Benutzerpasswort über REST Drupal 8.x

Die einfache Anforderung ist wie, Benutzer muss sein Passwort durch Eingabe seines alten und neuen Passwortes aktualisieren.

Von Google fand ich this link und mit ihm aber Ich verstehe nicht, wie man neues Passwort sendet?

HTTP-Anfrage ist wie folgt.

Methode:

PATCH 

HEADER:

Authorization:Bearer <token> 
Content-Type:application/hal+json 

Körper:

{ 
    "_links": { 
     "type": { 
      "href": "{domain}/rest/type/user/user" 
     } 
    }, 
    "pass": [ 
     {"existing":"testpass"} 
    ] 
} 

Nun, wie hier neues Passwort setzen?

Antwort

3

Analogously der Aktualisierung Mail-Aktion

{ 
"_links": { 
    "type": { 
    "href": "{domain}/rest/type/user/user" 
    } 
}, 
"pass":[{"existing":"testpass"}], 
"mail":{ 
    "value":"[email protected]" 
} 
} 

sollte es etw wie

{ 
    "_links": { 
     "type": { 
      "href": "{domain}/rest/type/user/user" 
     } 
    }, 
    "pass": [ 
     {"existing":"testpass", "value": "newpass"} 
    ] 
} 
sein