Unity Player Accounts
개요
Unity Player Accounts는 게임, 기기, 플랫폼 간 일관성을 지원하는 Unity의 종합 로그인 솔루션입니다. Unity Player Accounts는 사용자 플로 UX, 이메일 및 비밀번호, 소셜 로그인 옵션, 데이터 액세스 및 삭제 플로가 포함된 종합 계정 시스템입니다.
Unity Player Accounts는 Unity Gaming Services와 연동되며 익명, Apple, Google, Facebook, Steam과 함께 Authentication이 지원하는 ID 제공업체 중 하나이고, SSO, 조직 수준의 플레이어 풀과 크로스 게임, 크로스 디바이스, 크로스 플랫폼 게임플레이와 같은 이점을 제공합니다.
기술적 기능 | 설명 |
---|---|
Unity Gaming Services 및 Unity 에디터와 연동 | Player Accounts는 Unity Gaming Services와 Unity 생태계에서 사용할 수 있는 뛰어난 로그인 및 ID 솔루션입니다. Authentication과 원활하게 연동되며 조직 수준의 플레이어 식별자와 같은 추가 기능을 제공합니다. |
크로스 플랫폼 및 크로스 디바이스 | 플레이어가 iOS, Android, Windows, Mac을 비롯한 다양한 플랫폼에서 게임에 가입하고 로그인할 수 있습니다. |
크로스 게임 | 조직 수준의 플레이어 식별자를 활용해 모든 게임에서 동일한 플레이어 프로필을 관리할 수 있습니다. |
사용자의 가입 및 로그인 여정 간소화 | 플레이어가 이메일과 비밀번호를 사용하거나 Google 또는 Apple 같은 소셜 계정을 사용하는 등 원하는 방법으로 계정에 가입하고 로그인할 수 있습니다. |
원활한 로그인 경험 | 처음부터 계정을 생성하지 않아도 되도록, 플레이어가 익명으로 시작한 후 게임 진행률을 유지한 상태에서 나중에 Player Account로 업그레이드하게 할 수 있습니다. 또한 SSO(Single Sign On)을 통해 플레이어가 한 번만 로그인하면 다시 자격 증명을 입력할 필요 없이 Player Accounts가 활성화된 모든 게임에 액세스할 수 있습니다. |
한 번의 연동으로 자동 업데이트 | 게임에 다시 연동하거나 업데이트할 필요 없이 브라우저 기반 가입 및 로그인 플로가 자동으로 새 기능을 업데이트합니다. 인증 솔루션을 다시 연동할 걱정 없이 게임을 개발하고 운영하는 데 집중할 수 있습니다. 연동된 후, Player Accounts가 자동으로 최신 보안 개선 사항과 기능을 업데이트합니다. |
시작하기
SDK 설치
Unity의 최신 Authentication 패키지를 설치하려면 다음 단계를 따르십시오.
- Unity 에디터에서 Window > Package Manager를 엽니다.
- Package Manager에서 Unity Registry 목록 뷰를 선택합니다.
- Authentication을 검색하거나 패키지 목록에서 찾습니다.
- 패키지를 선택한 후 Install을 선택합니다.
자세한 내용은 패키지 관리자 기술 자료를 참조하십시오.
Unity Player Accounts 설정
Unity Dashboard에서 직접 Unity Player Accounts를 설정할 수 있습니다.
Unity Player Accounts를 사용하려면 다음을 제공해야 합니다.
이름 | 설명 |
---|---|
서비스 약관 링크 | 애플리케이션의 서비스 약관이며, 애플리케이션 로그인 프로세스의 동의 단계(첫 로그인)에 링크를 표시해야 합니다. 참고: 초기 설정에서 이 링크는 선택 사항이지만, 출시하기 전에 서비스 약관 링크를 제공해야 합니다. |
개인정보 처리방침 링크 | 애플리케이션의 개인정보 처리방침이며, 애플리케이션 로그인 프로세스의 동의 단계(첫 로그인)에 링크를 표시해야 합니다. 참고: 초기 설정에서 이 링크는 선택 사항이지만, 출시하기 전에 개인정보 처리방침 링크를 제공해야 합니다. |
OAuth 클라이언트 이름 | OAuth 클라이언트의 이름입니다. 동의 단계 중에 사용자에게 표시되므로, 연동하는 애플리케이션의 이름처럼 식별 가능한 이름이어야 합니다. |
플랫폼 | 지원되는 플랫폼입니다. 현재 Unity Player Accounts는 iOS/Android 및 Windows를 지원합니다. |
게임 퍼블리시 전
Unity의 규정 준수 및 브랜딩 가이드라인을 검토하십시오.
- 플레이어가 애플리케이션과 Unity Player 계정에 대한 데이터 삭제 및 공개를 요청할 수 있는 수단을 제공해야 합니다.
- Unity Player Accounts 계정 삭제 페이지에 대한 링크를 제공하십시오.
- 데이터 공개 또는 다른 개인정보 관련 요청을 할 수 있도록 Unity Player Accounts 개인정보 지원 이메일에 대한 링크를 제공하십시오.
- 데이터 공개 또는 다른 개인정보 관련 요청을 할 수 있도록 이메일에 대한 링크를 제공하십시오.
- Unity 서비스 약관을 항상 준수해야 합니다.
- 최종 사용자에게 데이터를 적절히 공개하고, 적합한 모든 개인정보 및 데이터 보호 법률과 규정을 준수하며, Unity Player Accounts 서비스를 사용함에 있어 Unity에 필요한 권리를 부여하는 개인정보 처리방침을 항상 유지하고, 표시하며 준수해야 합니다.
서비스 약관 및 개인정보 보호
Unity Dashboard에 서비스 약관과 개인정보 보호 링크를 제공해야 합니다.
SDK 연동
Unity Player Accounts 로그인 설정
패키지를 설치한 후 에디터 메뉴에서 Services > Unity Player Accounts > Settings를 선택합니다.
참고: 이 에셋은 Assets/Resources
에 생성됩니다.
온보딩 후 가져온 다음 값을 추가합니다.
- Client ID
- Scope(선택 사항. All 또는 Empty는 허용된 모든 범위를 의미)
- Use Custom Deep Link Uri(선택 사항. 기본 딥링크 URI를 오버라이드)
참고: 등록된 URI가 규정된 형식을 따른다면 리디렉트 URI를 설정할 필요 없이 인증 과정이 작동합니다.
- Desktop/Standalone:
http://localhost/callback
- Android/IOS 기본 딥링크 URI:
unitydl://com.unityplayeraccounts.{unity-project-id}
Unity Player Accounts 샘플
참고: 샘플은 표준 Unity 입력 시스템으로 제작되었습니다. 입력 관리자 또는 두 입력 시스템을 모두 활성화하십시오. Unity 에디터에서 Edit > Project Settings > Player > Other Settings > Active Input Handling으로 이동하십시오.
Window > Package Manager를 선택해 샘플을 임포트합니다. Authentication을 찾고 Samples에서 Import를 선택합니다.
Assets > Samples > Authentication > [Package-Version] > UI Example > UnityPlayerAccountsUIExample 아래의 샘플 씬을 엽니다.
Unity Authentication 서비스와 연동
Unity Authentication의 Unity Player 계정 ID 제공업체를 설정합니다.
- Unity 에디터 메뉴에서 **Edit > Project Settings...**로 이동한 후, 내비게이션 메뉴에서 Services > Authentication을 선택합니다.
- Go to Dashboard를 선택해 Authentication ID 제공업체 웹 페이지를 엽니다.
- 웹 페이지에서 Add Identity Provider를 선택하고 Unity Player Accounts를 선택합니다.
- 제공업체를 설정하고 팝업 창에서 Add provider를 선택합니다.
- Unity 에디터에서 Services > Authentication으로 돌아가서 Refresh를 선택합니다. Unity Player Accounts ID 제공업체가 표시됩니다.
- Unity 에디터에서 Services > Authentication > Player Account Settings로 이동하여 클라이언트 ID가 올바르게 설정되었는지 확인합니다.
- 앞서 임포트한 패키지 샘플 씬 UnityPlayerAccountsUIExample을 실행합니다.
참고: SignedIn
이벤트에 가입하면 사용자가 Unity Player 계정에 성공적으로 로그인하고 필요한 액세스 토큰을 받을 때 로그인 메서드가 호출되도록 하는 데 필요합니다.
void Awake()
{
PlayerAccountService.Instance.SignedIn += SignInWithUnity;
}
기존 플레이어 로그인 또는 신규 플레이어 생성
SignInWithUnityAsync
메서드를 사용하여 다음 중 하나를 수행할 수 있습니다.
- Unity Player 계정 자격 증명 정보를 사용해 새 Unity Authentication 플레이어 생성
- Unity Player 계정 자격 증명 정보를 사용해 기존 플레이어 로그인
async Task SignInWithUnityAsync(string accessToken)
{
try
{
await AuthenticationService.Instance.SignInWithUnityAsync(accessToken);
Debug.Log("SignIn is successful.");
}
catch (AuthenticationException ex)
{
// Compare error code to AuthenticationErrorCodes
// Notify the player with the proper error message
Debug.LogException(ex);
}
catch (RequestFailedException ex)
{
// Compare error code to CommonErrorCodes
// Notify the player with the proper error message
Debug.LogException(ex);
}
}
플레이어를 익명에서 Unity Player 계정으로 업데이트
익명 인증을 설정한 후, 플레이어가 Unity Player 계정을 생성하고 이를 통해 로그인하도록 업그레이드하려는 경우, 게임이 플레이어에게 Unity Player Accounts 로그인 창을 표시하고 Unity Player Accounts에서 액세스 토큰을 가져와야 합니다. 그런 다음 LinkWithUnityAsync
API를 호출해 플레이어를 Unity Player 계정 액세스 토큰에 연결합니다.
SDK에 캐시된 플레이어가 존재하는 경우, 캐시된 플레이어를 Unity Player 계정에 연결할 수 있습니다.
SignInAnonymouslyAsync
를 사용해 캐시된 플레이어의 계정에 로그인합니다.LinkWithUnityAsync
를 사용해 캐시된 플레이어의 계정을 Unity Player 계정에 연결합니다.
캐시된 플레이어에 대한 자세한 내용은 캐시된 사용자 로그인 섹션을 참고하십시오.
async Task LinkWithUnityAsync(string accessToken)
{
try
{
await AuthenticationService.Instance.LinkWithUnityAsync(accessToken);
Debug.Log("Link is successful.");
}
catch (AuthenticationException ex) when (ex.ErrorCode == AuthenticationErrorCodes.AccountAlreadyLinked)
{
// Prompt the player with an error message.
Debug.LogError("This user is already linked with another account. Log in instead.");
}
catch (AuthenticationException ex)
{
// Compare error code to AuthenticationErrorCodes
// Notify the player with the proper error message
Debug.LogException(ex);
}
catch (RequestFailedException ex)
{
// Compare error code to CommonErrorCodes
// Notify the player with the proper error message
Debug.LogException(ex);
}
}
Unity Player 계정 연결 해제
플레이어가 Unity Player 계정 연결을 해제할 수 있도록 UnlinkUnityAsync
API를 사용합니다. 연결이 해제되면 계정이 다른 ID에 연결되지 않은 경우 익명 계정으로 전환됩니다.
async Task UnlinkUnityAsync(string idToken)
{
try
{
await AuthenticationService.Instance.UnlinkUnityAsync(idToken);
Debug.Log("Unlink is successful.");
}
catch (AuthenticationException ex)
{
// Compare error code to AuthenticationErrorCodes
// Notify the player with the proper error message
Debug.LogException(ex);
}
catch (RequestFailedException ex)
{
// Compare error code to CommonErrorCodes
// Notify the player with the proper error message
Debug.LogException(ex);
}
}