개요
사용자 속성
인증 플랫폼으로서, Casdoor는 사용자를 관리할 수 있습니다. 모든 사용자는 다음과 같은 속성을 가지고 있습니다:
Owner: 사용자를 소유한 조직Name: 고유한 사용자 이름생성된시간업데이트된시간Id: 각 사용자에 대한 고유 식별자TypePasswordPasswordSaltPasswordOptions: 비밀번호 복잡성 옵션DisplayName: 사용자 인터페이스에 표시됨이름성Avatar: 사용자의 아바타로 연결되는 링크PermanentAvatar이메일전화위치주소소속제목IdCardTypeIdCard홈페이지자기소개태그지역언어성별생일교육점수카르마순위IsDefaultAvatarIsOnlineIsAdmin: 사용자가 자신의 조직의 관리자인지 여부를 나타냄IsGlobalAdmin: 사용자가 Casdoor을 관리할 권한이 있는지 여부를 나타냄IsForbiddenIsDeleted: When a user is soft-deleted (IsDeleted = true), they cannot sign in through any authentication method, including OAuth providers. This prevents deleted users from re-registering via third-party login.가입신청해시PreHash생성된 IP마지막 로그인 시간마지막 로그인 IPRoles: An array of the user's roles (extended field, read-only via User API)Permissions: An array of the user's permissions (extended field, read-only via User API)
소셜 플랫폼 로그인을 위한 고유 ID:
GithubGoogleQQWeChatFacebookDingTalkWeiboGiteeLinkedInWecomLarkGitlabAdfsBaiduCasdoorInfoflowAppleAzure ADAzure AD B2CSlackSteamLdap
Email Normalization
Casdoor normalizes all email addresses to lowercase to ensure uniqueness and prevent duplicate accounts. This means that user@example.com, User@Example.com, and USER@EXAMPLE.COM are treated as the same email address, complying with RFC 5321 standards.
This normalization happens automatically during:
- User signup and account creation
- User login and authentication
- Email duplicate checking
Understanding Roles and Permissions Fields
The Roles and Permissions fields in the User object are extended fields that are dynamically populated when retrieving user data. These fields are not stored directly in the User table but are collected from the Roles and Permissions resources through the ExtendUserWithRolesAndPermissions() function.
Important: You cannot update roles and permissions through the /api/update-user endpoint, even when using the columns parameter. To manage user roles and permissions, you must use the dedicated APIs for Roles and Permissions resources.
To assign roles or permissions to users:
- Roles: Use the Roles API endpoints to create and assign roles. Visit the Roles management page (e.g.,
https://door.casdoor.com/roles) or use the roles API. - Permissions: Use the Permissions API endpoints to create and assign permissions. Visit the Permissions management page (e.g.,
https://door.casdoor.com/permissions) or use the permissions API.
Using the Properties Field
The Properties field is a flexible key-value map (map[string]string) that allows you to store custom attributes for users beyond the predefined fields in the User schema. This is particularly useful when you need to:
- Store organization-specific user attributes
- Add custom metadata that doesn't fit into standard fields
- Extend user profiles without modifying the core schema
XLSX 파일에서 사용자 가져오기
사용자 정보가 포함된 XLSX 파일을 업로드하여 새 사용자를 추가하거나 기존 Casdoor 사용자를 업데이트할 수 있습니다.
관리 콘솔에서 사용자로 이동하고 업로드 (.xlsx) 버튼을 클릭합니다.

XLSX 파일을 선택하고 열기를 클릭합니다. 사용자가 가져와집니다.
xlsx 폴더에 user_test.xlsx라는 이름의 템플릿 XLSX 파일을 제공합니다. 템플릿에는 5명의 테스트 사용자와 일부 필요한 사용자 속성에 대한 헤더가 포함되어 있습니다.

비밀번호 암호화 우회
외부 데이터베이스에서 Casdoor로 사용자를 마이그레이션할 때, organization 기본 비밀번호 유형 방법에 의해 제공되는 기본 암호화 방법을 우회하거나 제어하려는 상황이 있을 수 있습니다.
이는 사용자를 가져올 때 passwordType 필드를 사용함으로써 달성할 수 있습니다.
Bycrypt 비밀번호를 가진 사용자
아래는 API 경로 /api/add-user에 대한 POST 본문 요청의 예입니다.
{
"owner": "organization",
"signupApplication": "first-app",
"email":"dev@dev.com",
"name": "dev",
"displayName": "developper",
"password": "$2a$10$.o/iVyDE9Xk8ioywHDnQRu72RviOi6FPa1ujhusbSCZeg7VOa6MY6",
"passwordType":"bcrypt",
}
여기서 사용자의 비밀번호는 이미 bcrypt 알고리즘을 사용하여 암호화되었으므로, Casdoor에 다시 암호화하지 않도록 passwordType을 "bcrypt"로 지정합니다.