Skip to main content
Skip to content

LDAP에 대한 REST API 엔드포인트

REST API를 사용하여 GitHub Enterprise Server 사용자 또는 팀과 연결된 LDAP 항목 사이의 계정 관계를 업데이트하거나 새 동기화를 대기열에 추가합니다.

LDAP 정보

이 엔드포인트를 사용하면 사용자 또는 팀이 매핑하는 DN(고유 이름)을 업데이트할 수 있습니다. 대부분의 경우 어플라이언스에 대해 LDAP 동기화를 사용하도록 설정 해야 합니다 GitHub Enterprise Server . 사용자에 대한 LDAP 매핑 업데이트 엔드포인트는 LDAP 동기화가 사용하지 않도록 설정된 경우에도 LDAP를 사용할 때 사용할 수 있습니다.

참고

이러한 엔드포인트는 personal access token (classic)을(를) 사용하는 인증만 지원합니다. 자세한 내용은 개인용 액세스 토큰 관리을(를) 참조하세요.

Update LDAP mapping for a team

Updates the distinguished name (DN) of the LDAP entry to map to a team. LDAP synchronization must be enabled to map LDAP entries to a team. Use the Create a team endpoint to create a team with LDAP mapping.

"Update LDAP mapping for a team"에 대한 세분화된 액세스 토큰

이 엔드포인트는 GitHub 앱 사용자 액세스 토큰, GitHub 앱 설치 액세스 토큰 또는 세분화된 개인용 액세스 토큰에서 작동하지 않습니다.

"Update LDAP mapping for a team"에 대한 매개 변수

머리글
이름, 유형, 설명
accept string

Setting to application/vnd.github+json is recommended.

경로 매개 변수
이름, 유형, 설명
team_id integer 필수

The unique identifier of the team.

본문 매개 변수
이름, 유형, 설명
ldap_dn string 필수

The distinguished name (DN) of the LDAP entry to map to a team.

"Update LDAP mapping for a team"에 대한 HTTP 응답 상태 코드

상태 코드설명
200

OK

"Update LDAP mapping for a team"에 대한 코드 샘플

요청 예제

patch/admin/ldap/teams/{team_id}/mapping
curl -L \ -X PATCH \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ http(s)://HOSTNAME/api/v3/admin/ldap/teams/TEAM_ID/mapping \ -d '{"ldap_dn":"cn=Enterprise Ops,ou=teams,dc=github,dc=com"}'

Response

Status: 200
{ "ldap_dn": "cn=Enterprise Ops,ou=teams,dc=github,dc=com", "id": 1, "node_id": "MDQ6VGVhbTE=", "url": "https://HOSTNAME/teams/1", "html_url": "https://github.com/orgs/github/teams/justice-league", "name": "Justice League", "slug": "justice-league", "description": "A great team.", "privacy": "closed", "notification_setting": "notifications_enabled", "permission": "admin", "members_url": "https://HOSTNAME/teams/1/members{/member}", "repositories_url": "https://HOSTNAME/teams/1/repos", "parent": null }

Sync LDAP mapping for a team

Note that this API call does not automatically initiate an LDAP sync. Rather, if a 201 is returned, the sync job is queued successfully, and is performed when the instance is ready.

"Sync LDAP mapping for a team"에 대한 세분화된 액세스 토큰

이 엔드포인트는 GitHub 앱 사용자 액세스 토큰, GitHub 앱 설치 액세스 토큰 또는 세분화된 개인용 액세스 토큰에서 작동하지 않습니다.

"Sync LDAP mapping for a team"에 대한 매개 변수

머리글
이름, 유형, 설명
accept string

Setting to application/vnd.github+json is recommended.

경로 매개 변수
이름, 유형, 설명
team_id integer 필수

The unique identifier of the team.

"Sync LDAP mapping for a team"에 대한 HTTP 응답 상태 코드

상태 코드설명
201

Created

"Sync LDAP mapping for a team"에 대한 코드 샘플

요청 예제

post/admin/ldap/teams/{team_id}/sync
curl -L \ -X POST \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ http(s)://HOSTNAME/api/v3/admin/ldap/teams/TEAM_ID/sync

Response

Status: 201
{ "status": "queued" }

Update LDAP mapping for a user

"Update LDAP mapping for a user"에 대한 세분화된 액세스 토큰

이 엔드포인트는 GitHub 앱 사용자 액세스 토큰, GitHub 앱 설치 액세스 토큰 또는 세분화된 개인용 액세스 토큰에서 작동하지 않습니다.

"Update LDAP mapping for a user"에 대한 매개 변수

머리글
이름, 유형, 설명
accept string

Setting to application/vnd.github+json is recommended.

경로 매개 변수
이름, 유형, 설명
username string 필수

The handle for the GitHub user account.

본문 매개 변수
이름, 유형, 설명
ldap_dn string 필수

The distinguished name (DN) of the LDAP entry to map to a team.

"Update LDAP mapping for a user"에 대한 HTTP 응답 상태 코드

상태 코드설명
200

OK

"Update LDAP mapping for a user"에 대한 코드 샘플

요청 예제

patch/admin/ldap/users/{username}/mapping
curl -L \ -X PATCH \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ http(s)://HOSTNAME/api/v3/admin/ldap/users/USERNAME/mapping \ -d '{"ldap_dn":"uid=asdf,ou=users,dc=github,dc=com"}'

Response

Status: 200
{ "ldap_dn": "uid=asdf,ou=users,dc=github,dc=com", "login": "octocat", "id": 1, "node_id": "MDQ6VXNlcjE=", "avatar_url": "https://github.com/images/error/octocat_happy.gif", "gravatar_id": "", "url": "https://HOSTNAME/users/octocat", "html_url": "https://github.com/octocat", "followers_url": "https://HOSTNAME/users/octocat/followers", "following_url": "https://HOSTNAME/users/octocat/following{/other_user}", "gists_url": "https://HOSTNAME/users/octocat/gists{/gist_id}", "starred_url": "https://HOSTNAME/users/octocat/starred{/owner}{/repo}", "subscriptions_url": "https://HOSTNAME/users/octocat/subscriptions", "organizations_url": "https://HOSTNAME/users/octocat/orgs", "repos_url": "https://HOSTNAME/users/octocat/repos", "events_url": "https://HOSTNAME/users/octocat/events{/privacy}", "received_events_url": "https://HOSTNAME/users/octocat/received_events", "type": "User", "site_admin": false, "name": "monalisa octocat", "company": "GitHub", "blog": "https://github.com/blog", "location": "San Francisco", "email": "octocat@github.com", "hireable": false, "bio": "There once was...", "twitter_username": "monatheoctocat", "public_repos": 2, "public_gists": 1, "followers": 20, "following": 0, "created_at": "2008-01-14T04:33:35Z", "updated_at": "2008-01-14T04:33:35Z", "private_gists": 81, "total_private_repos": 100, "owned_private_repos": 100, "disk_usage": 10000, "collaborators": 8, "two_factor_authentication": true, "plan": { "name": "Medium", "space": 400, "private_repos": 20, "collaborators": 0 } }

Sync LDAP mapping for a user

Note that this API call does not automatically initiate an LDAP sync. Rather, if a 201 is returned, the sync job is queued successfully, and is performed when the instance is ready.

"Sync LDAP mapping for a user"에 대한 세분화된 액세스 토큰

이 엔드포인트는 GitHub 앱 사용자 액세스 토큰, GitHub 앱 설치 액세스 토큰 또는 세분화된 개인용 액세스 토큰에서 작동하지 않습니다.

"Sync LDAP mapping for a user"에 대한 매개 변수

머리글
이름, 유형, 설명
accept string

Setting to application/vnd.github+json is recommended.

경로 매개 변수
이름, 유형, 설명
username string 필수

The handle for the GitHub user account.

"Sync LDAP mapping for a user"에 대한 HTTP 응답 상태 코드

상태 코드설명
201

Created

"Sync LDAP mapping for a user"에 대한 코드 샘플

요청 예제

post/admin/ldap/users/{username}/sync
curl -L \ -X POST \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ http(s)://HOSTNAME/api/v3/admin/ldap/users/USERNAME/sync

Response

Status: 201
{ "status": "queued" }