Skip to content

Commit

Permalink
Add support for importing users with PHPass hashes (#436)
Browse files Browse the repository at this point in the history
  • Loading branch information
shilgapira authored May 8, 2024
1 parent 19e0e2e commit d8a585e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions descope/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,7 @@ type BatchUserPasswordHashed struct {
Firebase *BatchUserPasswordFirebase `json:"firebase,omitempty"`
Pbkdf2 *BatchUserPasswordPbkdf2 `json:"pbkdf2,omitempty"`
Django *BatchUserPasswordDjango `json:"django,omitempty"`
Phpass *BatchUserPasswordPhpass `json:"phpass,omitempty"`
}

type BatchUserPasswordBcrypt struct {
Expand All @@ -424,6 +425,13 @@ type BatchUserPasswordDjango struct {
Hash string `json:"hash"` // the django hash in plaintext format, for example "pbkdf2_sha256$..."
}

type BatchUserPasswordPhpass struct {
Hash string `json:"hash"` // the hash as base64 encoded string with . and / characters
Salt string `json:"salt"` // the salt as base64 encoded string with . and / characters
Iterations int `json:"iterations"` // the iterations cost value (usually in the tens of thousands)
Type string `json:"type"` // the hash name (md5, sha512)
}

type UserResponse struct {
User `json:",inline"`
UserID string `json:"userId,omitempty"`
Expand Down

0 comments on commit d8a585e

Please sign in to comment.