ICompositeAuthenticator 의 확장 메서드를 통해서 Authenticator 를 추가하세요.
예시
using XboxAuthNet.Game;
var clientInfo = new MicrosoftOAuthClientInfo("<MICROSOFT_OAUTH_CLIENT_ID>", "<MICROSOFT_OAUTH_SCOPES>");
var authenticator = // create authenticator using login handlers
// example 1
authenticator.AddForceMicrosoftOAuth(clientInfo, oauth => oauth.Interactive());
// example 2
authenticator.AddMicrosoftOAuth(clientInfo, oauth => oauth.Silent());
// example 3 (with CmlLib.Core.Auth.Microsoft)
authenticator.AddMicrosoftOAuthForJE(oauth => oauth.Interactive());
AddMicrosoftOAuth / AddForceMicrosoftOAuth
AddMicrosoftOAuth 는 먼저 캐시된 Microsoft OAuth 세션의 유효성을 검사하고 만약 세션이 유효하다면 인증을 진행하지 않고 다음 authenticator 로 넘어갑니다.
이 메서드는 마이크로소프트 OAuth 로그인 페이지를 표시하기 위해서 Microsoft WebView2 를 사용합니다. 이 내용을 반드시 숙지하고 있어야 합니다.
Microsoft WebView2 는 Windows 에서만 사용 가능합니다. 다른 플랫폼에서 사용하기 위해서는 XboxAuthNet.Game.Msal가 필요합니다.
WebView2 를 사용하기 위해서는 유저들은 (개발자와 최종 사용자 포함) 반드시 WebView2 Runtime이 설치되어 있어야 합니다.이 문서를 참고하여 런처를 WebView2와 함께 배포하는 방법을 알아보세요. (예를 들어 런타임 설치를 direct download link 로 자동화 할 수 있습니다: https://go.microsoft.com/fwlink/p/?LinkId=2124703)