OnlineIdAuthenticator 클래스

정의

사용자가 Live ConnectAPI를 사용하여 앱에 동의한 데이터를 가져오는 데 사용할 수 있는 JSON(JavaScript Object Notation) 토큰을 서비스와 함께 가져오는 인증 요청을 시작하는 기능을 앱에 제공합니다.

데스크톱 앱에서 UI를 표시하는 방식으로 이 클래스의 instance 사용하기 전에 개체를 소유자의 창 핸들과 연결해야 합니다. 자세한 정보 및 코드 예제는 CoreWindow에 의존하는 WinRT UI 개체 표시를 참조하세요.

참고

Windows 10 이상용으로 개발하는 경우 Windows.Security.Authentication.Web.Core API를 대신 사용합니다. 자세한 내용은 웹 계정 관리자를 참조하세요.

public ref class OnlineIdAuthenticator sealed
/// [Windows.Foundation.Metadata.Activatable(65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class OnlineIdAuthenticator final
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
class OnlineIdAuthenticator final
[Windows.Foundation.Metadata.Activatable(65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class OnlineIdAuthenticator
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
public sealed class OnlineIdAuthenticator
function OnlineIdAuthenticator()
Public NotInheritable Class OnlineIdAuthenticator
상속
Object Platform::Object IInspectable OnlineIdAuthenticator
특성

Windows 요구 사항

디바이스 패밀리
Windows 10 (10.0.10240.0에서 도입되었습니다.)
API contract
Windows.Foundation.UniversalApiContract (v1.0에서 도입되었습니다.)

예제

다음 예제에서는 사용자 인증 요청을 처리하는 방법을 보여줍니다.

function signIn() {
    var authenticator = new Windows.Security.Authentication.OnlineId.OnlineIdAuthenticator();
    var serviceTicketRequest = new Windows.Security.Authentication.OnlineId.OnlineIdServiceTicketRequest(
        "wl.basic wl.contacts_photos wl.calendars", "DELEGATION");

    sdkSample.displayStatus("Signing in...");

    authenticator.authenticateUserAsync(serviceTicketRequest)
        .done(function (authResult) {

            if ((authResult.tickets.size == 1) && (authResult.tickets[0].errorCode == 0)) {
                sdkSample.isSignedIn = true;
                sdkSample.displayStatus("Authorization succeeded.");
                sdkSample.accessToken = authResult.tickets[0];
                sdkSample.canSignOut = authenticator.canSignOut;
            }
        },

            function (authStatus) {
                if (authStatus && (authStatus.name !== "Canceled")) {
                    showErrorMessage("Autorization failed: " + authStatus.message);
                } else {
                    sdkSample.displayStatus("");
                }
                    showAccountStatus();
                });
}

생성자

OnlineIdAuthenticator()

OnlineIdAuthenticator의 instance 만듭니다.

데스크톱 앱에서 UI를 표시하는 방식으로 이 클래스의 instance 사용하기 전에 개체를 소유자의 창 핸들과 연결해야 합니다. 자세한 정보 및 코드 예제는 CoreWindow에 의존하는 WinRT UI 개체 표시를 참조하세요.

참고

Windows 10 이상용으로 개발하는 경우 Windows.Security.Authentication.Web.Core API를 대신 사용합니다. 자세한 내용은 웹 계정 관리자를 참조하세요.

속성

ApplicationId

애플리케이션의 ID를 GUID로 반환합니다.

참고

Windows 10 이상용으로 개발하는 경우 Windows.Security.Authentication.Web.Core API를 대신 사용합니다. 자세한 내용은 웹 계정 관리자를 참조하세요.

AuthenticatedSafeCustomerId

앱에 대해 성공적으로 인증된 사용자의 ID를 반환합니다.

참고

Windows 10 이상용으로 개발하는 경우 Windows.Security.Authentication.Web.Core API를 대신 사용합니다. 자세한 내용은 웹 계정 관리자를 참조하세요.

CanSignOut

사용자가 앱에서 로그아웃할 수 있는지 여부와 앱에 로그아웃 링크를 표시할지 여부를 나타냅니다.

참고

Windows 10 이상용으로 개발하는 경우 Windows.Security.Authentication.Web.Core API를 대신 사용합니다. 자세한 내용은 웹 계정 관리자를 참조하세요.

메서드

AuthenticateUserAsync(IIterable<OnlineIdServiceTicketRequest>, CredentialPromptType)

여러 OnlineIdServiceTicketRequests 를 사용하여 비동기 인증 요청을 시작하고 티켓을 가져오기 위해 CredentialPromptType 을 설정하여 사용자 환경을 제어하는 기능을 제공합니다. 사용자가 Microsoft 계정으로 Windows 8 시스템에 로그인한 경우 이 사용자는 인증 요청에 사용됩니다.

참고

Windows 10 이상용으로 개발하는 경우 Windows.Security.Authentication.Web.Core API를 대신 사용합니다. 자세한 내용은 웹 계정 관리자를 참조하세요.

AuthenticateUserAsync(OnlineIdServiceTicketRequest)

자격 증명 또는 동의를 수집하고 티켓을 가져오는 데 필요한 경우 자격 증명 프롬프트를 표시하여 하나의 OnlineIdServiceTicketRequest 를 사용하여 비동기 인증 요청을 시작합니다. 사용자가 Microsoft 계정으로 Windows 8 시스템에 로그인한 경우 이 사용자는 인증 요청에 사용됩니다.

참고

Windows 10 이상용으로 개발하는 경우 Windows.Security.Authentication.Web.Core API를 대신 사용합니다. 자세한 내용은 웹 계정 관리자를 참조하세요.

SignOutUserAsync()

사용자가 앱에서 로그아웃할 수 있습니다.

참고

Windows 10 이상용으로 개발하는 경우 Windows.Security.Authentication.Web.Core API를 대신 사용합니다. 자세한 내용은 웹 계정 관리자를 참조하세요.

적용 대상