Validate Password
curl --request POST \
--url http://{host}:{port}/{contextPath}/identity/password-policy \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"password": "myPassword",
"profile": {
"id": "jonny1",
"firstName": "John",
"lastName": "Doe",
"email": "jonny@camunda.org"
}
}
'import requests
url = "http://{host}:{port}/{contextPath}/identity/password-policy"
payload = {
"password": "myPassword",
"profile": {
"id": "jonny1",
"firstName": "John",
"lastName": "Doe",
"email": "jonny@camunda.org"
}
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
password: 'myPassword',
profile: {id: 'jonny1', firstName: 'John', lastName: 'Doe', email: 'jonny@camunda.org'}
})
};
fetch('http://{host}:{port}/{contextPath}/identity/password-policy', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "62437",
CURLOPT_URL => "http://{host}:{port}/{contextPath}/identity/password-policy",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'password' => 'myPassword',
'profile' => [
'id' => 'jonny1',
'firstName' => 'John',
'lastName' => 'Doe',
'email' => 'jonny@camunda.org'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://{host}:{port}/{contextPath}/identity/password-policy"
payload := strings.NewReader("{\n \"password\": \"myPassword\",\n \"profile\": {\n \"id\": \"jonny1\",\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"email\": \"jonny@camunda.org\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://{host}:{port}/{contextPath}/identity/password-policy")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"password\": \"myPassword\",\n \"profile\": {\n \"id\": \"jonny1\",\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"email\": \"jonny@camunda.org\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://{host}:{port}/{contextPath}/identity/password-policy")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"password\": \"myPassword\",\n \"profile\": {\n \"id\": \"jonny1\",\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"email\": \"jonny@camunda.org\"\n }\n}"
response = http.request(request)
puts response.read_body{
"rules": [
{
"placeholder": "PASSWORD_POLICY_USER_DATA",
"parameter": null,
"valid": true
},
{
"placeholder": "PASSWORD_POLICY_LOWERCASE",
"parameter": {
"minLowerCase": "1"
},
"valid": true
},
{
"placeholder": "PASSWORD_POLICY_LENGTH",
"parameter": {
"minLength": "10"
},
"valid": false
},
{
"placeholder": "PASSWORD_POLICY_UPPERCASE\"",
"parameter": {
"minUpperCase": "1"
},
"valid": false
},
{
"placeholder": "PASSWORD_POLICY_DIGIT",
"parameter": {
"minDigit": "1"
},
"valid": false
},
{
"placeholder": "PASSWORD_POLICY_SPECIAL",
"parameter": {
"minSpecial": "1"
},
"valid": false
}
],
"valid": false
}{
"type": "<string>",
"message": "<string>",
"code": 123
}身份
验证密码
A password policy consists of a list of rules that new passwords must follow to be policy compliant. A password can be checked for compliancy via this end point. More information on password policies in Camunda can be found in the password policy user guide and in the security instructions.
POST
/
identity
/
password-policy
Validate Password
curl --request POST \
--url http://{host}:{port}/{contextPath}/identity/password-policy \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"password": "myPassword",
"profile": {
"id": "jonny1",
"firstName": "John",
"lastName": "Doe",
"email": "jonny@camunda.org"
}
}
'import requests
url = "http://{host}:{port}/{contextPath}/identity/password-policy"
payload = {
"password": "myPassword",
"profile": {
"id": "jonny1",
"firstName": "John",
"lastName": "Doe",
"email": "jonny@camunda.org"
}
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
password: 'myPassword',
profile: {id: 'jonny1', firstName: 'John', lastName: 'Doe', email: 'jonny@camunda.org'}
})
};
fetch('http://{host}:{port}/{contextPath}/identity/password-policy', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "62437",
CURLOPT_URL => "http://{host}:{port}/{contextPath}/identity/password-policy",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'password' => 'myPassword',
'profile' => [
'id' => 'jonny1',
'firstName' => 'John',
'lastName' => 'Doe',
'email' => 'jonny@camunda.org'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://{host}:{port}/{contextPath}/identity/password-policy"
payload := strings.NewReader("{\n \"password\": \"myPassword\",\n \"profile\": {\n \"id\": \"jonny1\",\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"email\": \"jonny@camunda.org\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://{host}:{port}/{contextPath}/identity/password-policy")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"password\": \"myPassword\",\n \"profile\": {\n \"id\": \"jonny1\",\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"email\": \"jonny@camunda.org\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://{host}:{port}/{contextPath}/identity/password-policy")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"password\": \"myPassword\",\n \"profile\": {\n \"id\": \"jonny1\",\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"email\": \"jonny@camunda.org\"\n }\n}"
response = http.request(request)
puts response.read_body{
"rules": [
{
"placeholder": "PASSWORD_POLICY_USER_DATA",
"parameter": null,
"valid": true
},
{
"placeholder": "PASSWORD_POLICY_LOWERCASE",
"parameter": {
"minLowerCase": "1"
},
"valid": true
},
{
"placeholder": "PASSWORD_POLICY_LENGTH",
"parameter": {
"minLength": "10"
},
"valid": false
},
{
"placeholder": "PASSWORD_POLICY_UPPERCASE\"",
"parameter": {
"minUpperCase": "1"
},
"valid": false
},
{
"placeholder": "PASSWORD_POLICY_DIGIT",
"parameter": {
"minDigit": "1"
},
"valid": false
},
{
"placeholder": "PASSWORD_POLICY_SPECIAL",
"parameter": {
"minSpecial": "1"
},
"valid": false
}
],
"valid": false
}{
"type": "<string>",
"message": "<string>",
"code": 123
}Authorizations
Body
application/json
Response
Request successful. This example uses the built-in password policy that enforces a minimum password length, and some complexity rules. The checked password is myPassword which is not complex enough to match all of the policy rules.