# SSO 연동 가이드

아키스케치 SSO(Single Sign-On)를 사용하면 파트너사의 자체 인증 시스템으로 대시보드에 로그인할 수 있어요.\
파트너 서버가 검증 토큰을 발급하고, 아키스케치가 이를 파트너 서버에 확인하는 방식이에요.

***

{% stepper %}
{% step %}
**아키스케치 기업 서비스 접속하기**

아키스케치와 계약한 다음에 아키스케치 기업 서비스에 로그인해주세요.

**설정 > 기업 설정 > 개발자 설정**으로 이동한 뒤 **'View/Update'** 버튼을 클릭해주세요.

<figure><img src="/files/J2efDtWvisegADObKuBL" alt=""><figcaption></figcaption></figure>

| 필드                        | 설명                                                                           | 필수 | 예시                                     |
| ------------------------- | ---------------------------------------------------------------------------- | -- | -------------------------------------- |
| Verification URL          | 파트너사 인증 서버의 검증 URL (GET 방식만 지원)                                              | O  | `https://your-service.com/oauth2/user` |
| Email Key                 | 검증 API 응답에서 이메일 필드명 (아키스케치 `email`에 매핑)                                      | O  | `email`                                |
| Name Key                  | 검증 API 응답에서 이름 필드명 (아키스케치 `name`에 매핑)                                        | O  | `name`                                 |
| UID Key                   | 검증 API 응답에서 사용자 고유 ID 필드명 (아키스케치 `uid`에 매핑)                                  | X  | `id`                                   |
| Avatar Key                | 검증 API 응답에서 아바타 이미지 URL 필드명 (아키스케치 `avatarImage`에 매핑)                        | X  | `profileImageUrl`                      |
| Use GET with Bearer Token | 검증 토큰 전달 방식. `true`: Authorization 헤더 Bearer, `false`: Query Parameter (기본값) | X  | `false`                                |
| Request Param Key         | Use GET with Bearer Token이 `false`일 때 사용할 Query Parameter 이름                 | X  | `token`                                |

{% hint style="info" %}
아키스케치가 파트너사 검증 서버를 호출할 때, 설정에 따라 두 가지 방식으로 토큰을 전달해요.

* **Query Parameter 방식** (기본): `GET {verificationUrl}?{paramKey}={verifyToken}`
* **Bearer Token 방식**: `GET {verificationUrl}` + `Authorization: Bearer {verifyToken}`
  {% endhint %}
  {% endstep %}

{% step %}
**연동 흐름 확인하기**

<figure><img src="/files/KMi08WdTmUefwQRSlBGu" alt=""><figcaption></figcaption></figure>

1. 사용자가 파트너사 서비스에서 로그인해요.
2. 파트너사 서버가 `verifyToken`을 생성하고, 아키스케치 로그인 API를 호출해요.
3. 아키스케치가 등록된 검증 URL로 `verifyToken`을 전달해 사용자 정보를 확인해요.
4. 검증에 성공하면 사용자를 생성(신규)하거나 업데이트(기존)하고 토큰을 반환해요.
5. 발급받은 토큰으로 대시보드에 인증할 수 있어요.
   {% endstep %}

{% step %}
**대시보드 리다이렉트하기**

발급받은 토큰으로 대시보드에 바로 인증 리다이렉트할 수 있어요.

```
https://{enterprise-subdomain}.archisketch.com/auth/sign-in?access_token={accessToken}&refresh_token={refreshToken}
```

{% endstep %}
{% endstepper %}

{% hint style="warning" %}
SSO 연동에 대한 질문이나 건의사항이 있다면 [연동/개발 문의](https://www.archisketch.com/ko/enterprisetrial/)에 문의해 주세요.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.archisketch.com/dev/api-2/sso.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
