> ## Documentation Index
> Fetch the complete documentation index at: https://documentation.ruoomsoftware.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 빠른 시작

> Single Sign-On 플러그인 1.0.0 설치 및 Google OAuth 구성

## 사전 요구 사항

* Python 3.10 이상과 Django 5.2를 사용하는 호환 Ruoom Core 1.x 환경.
* 라이선스가 적용된 `single_sign_on_plugin-1.0.0-py3-none-any.whl` 아티팩트.
* Google OAuth 사용 시 Google OAuth 클라이언트와 배포 도메인의 정확한 콜백 URL.

## 설치

```powershell theme={null}
python -m pip install .\single_sign_on_plugin-1.0.0-py3-none-any.whl
```

wheel은 고정 버전의 `social-auth-app-django` 의존성을 함께 설치합니다. `.env`에서 플러그인을 활성화합니다.

```text theme={null}
RUOOM_PLUGINS=single_sign_on
```

다음을 실행합니다.

```bash theme={null}
python manage.py migrate
python manage.py check
```

애플리케이션을 다시 시작합니다. Core가 메타데이터에 따라 플러그인 미들웨어를 설치하고 URL을 `/sso/`에 마운트합니다.

## Google OAuth 연동

사용하는 프로젝트에서 `social_django`를 Django 앱에 추가하고 OAuth URL을 포함하며 인증 백엔드에 `social_core.backends.google.GoogleOAuth2`를 추가해야 합니다. Google 클라이언트 ID, 클라이언트 보안 비밀번호 및 콜백 URL도 구성하십시오.

다음 파이프라인 순서를 사용합니다.

```python theme={null}
SOCIAL_AUTH_PIPELINE = [
    "social_core.pipeline.social_auth.social_details",
    "social_core.pipeline.social_auth.social_uid",
    "social_core.pipeline.social_auth.auth_allowed",
    "social_core.pipeline.social_auth.social_user",
    "social_core.pipeline.user.get_username",
    "plugins.single_sign_on.pipeline.base.get_username",
    "plugins.single_sign_on.pipeline.base.create_user",
    "social_core.pipeline.social_auth.associate_user",
    "social_core.pipeline.social_auth.load_extra_data",
    "social_core.pipeline.user.user_details",
]
```

## Core 설정

* `SSO_TEMP_BUSINESS_ID`: OAuth 가입 중 사용하는 임시 비즈니스.
* `SSO_TOKEN_TTL_SECONDS`: 일회용 토큰 유효 기간. 기본값 `3600`.
* `SSO_DEFAULT_REDIRECT_URL`, `SSO_STAFF_REDIRECT_URL`, `SSO_CUSTOMER_REDIRECT_URL`, `SSO_STANDALONE_REDIRECT_URL`: 역할별 이동 대상.
* `SSO_OAUTH_PATH_KEYWORDS`: 미들웨어가 OAuth/SSO 트래픽으로 취급할 경로.

비밀 값과 환경별 콜백 URL은 플러그인 패키지가 아니라 배포 환경에 보관하십시오.
