Skip to content

Password Configurations

cheehong1 edited this page Jan 17, 2024 · 4 revisions

Summary

Allow company manager to customize and define the password configurations for company users.

Operation
Retrieve company's Password Configuration
Upsert a configuration

Operations

Retrieve company's Password Configuration

If the company's password configuration settings are not defined, the will retrieve and apply default values from the 'Huddle' default

Link relations

Name Description Methods
self The URI of the Comments on the Task. GET
parent The URI of the Company. GET

Example

In this example, we request password configurations for company 123.

Request

GET /identity/companies/123/passwordConfigurations
Accept: application/vnd.huddle.data+json
Authorization: OAuth2 frootymcnooty/vonbootycherooty

JSON Response

If successful, this method will return a response with an OK status code.

HTTP/1.1 200 OK
Content-Type: application/vnd.huddle.data+json
{
  "configurations": {
    "usePasswordLengthConfig": true,
    "passwordMinLength": 8, 
    "passwordMaxLength": 16,
    "passwordUseUpperCase": true,
    "passwordUseLowerCase": true,
    "passwordUseNumber": true,
    "passwordUseSpecialChar": true,
    "usePasswordExpirationConfig": true,
    "passwordExpirationDays": 60, 
    "passwordExpirationWarning": true,
    "useAccountLockoutConfig": true,
    "accountMaxLoginAttempts": 6,
    "accountLockoutDuration": 60,
    "showLockoutNotification": true, 
    "sentLockoutNotification": true
  },
  "links":[
    { "rel": "self", "href": "..."  },
    { "rel": "parent", "href": "..."  }
  ]
}

Other Responses

Response Code Case
401 Unauthorized Invalid authorization token
403 Forbidden User is not a Workspace Manager

Upsert a configuration

This will handle both CREATE and UPDATE scenarios, acting as CREATE if there is no existing record of this configuration, and as UPDATE if a record already exists.

Request

Parameter Value
ruleType Rule Type in string
ruleValue? Number
active? Boolean

Example

In this example, we create/update password configuration for company 123.

JSON Request

If successful, this method will return a response with an OK status code.

POST /identity/companies/123/passwordConfigurations
Accept: application/vnd.huddle.data+json
Authorization: OAuth2 frootymcnooty/vonbootycherooty
{
  "ruleType": "passwordMaxLength",
  "ruleValue": 6,
  "active": true
}

Response

HTTP/1.1 200 OK
Content-Type: application/vnd.huddle.data+xml

Error Response (Invalid payload)

{
  "errorCode": 400,
  "errorMessages": "Rule type is not valid"
}
{
  "errorCode": 400,
  "errorMessages": "Password minimum length must not be lower than 4"
}
{
  "errorCode": 400,
  "errorMessages": "Rule type invalid payload"
}

Other Responses

Response Code Case
400 Bad Request Content is not valid
401 Unauthorized Invalid authorization token
403 Forbidden User is not a Workspace Manager
Classic
Clone this wiki locally