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

# XUserGetTokenAndSignatureOptions

> XUserGetTokenAndSignatureOptions

# XUserGetTokenAndSignatureOptions

[XUserGetTokenAndSignatureAsync](/reference/system/xuser/functions/xusergettokenandsignatureasync)의 옵션입니다.

## 구문

```cpp theme={null}
enum class XUserGetTokenAndSignatureOptions  : uint32_t  
{  
    None = 0x00,  
    ForceRefresh = 0x01,  
    AllUsers = 0x02,  
}  
```

## 상수

| 상수           | 설명                        |
| ------------ | ------------------------- |
| None         | 옵션이 없습니다.                 |
| ForceRefresh | 새로 고침을 강제합니다.             |
| AllUsers     | 모든 사용자에 대한 토큰과 서명을 가져옵니다. |

## 설명

[XUserGetTokenAndSignatureAsync](/reference/system/xuser/functions/xusergettokenandsignatureasync) 함수는 웹 요청을 위한 xtoken과 서명을 비동기적으로 가져오기 위해 XUserGetTokenAndSignatureOptions 열거형 인수를 사용합니다.

이와 유사하게, [XUserGetTokenAndSignatureUtf16Async](/reference/system/xuser/functions/xusergettokenandsignatureutf16async) 함수는 웹 요청을 위한 유니코드 xtoken과 서명을 비동기적으로 가져오기 위해 XUserGetTokenAndSignatureOptions 열거형 인수를 사용합니다.

다음 예제는 사용자의 토큰과 서명을 비동기적으로 가져오는 방법을 보여줍니다.

```cpp theme={null}
HRESULT RequestTokenComplete(XAsyncBlock* abResult)
{
    size_t bufferSize;
    RETURN_IF_FAILED(XUserGetTokenAndSignatureResultSize(abResult, &bufferSize));

    std::vector<uint8_t> buffer(bufferSize);
    XUserGetTokenAndSignatureData* data;
    if (SUCCEEDED_LOG(XUserGetTokenAndSignatureResult(abResult, buffer.size(), buffer.data(), &data, nullptr /*bufferUsed*/)))
    {
        appLog.AddLog("Token: %s\n", data->token);
        if (data->signature != nullptr)
        {    
            appLog.AddLog("Signature: %s\n", data->signature);
        }
    }

    return S_OK;
}

HRESULT RequestTokenAsync(
    XTaskQueueHandle queue,
    const char* url,
    bool forceRefresh)
{
    auto asyncBlock = std::make_unique<XAsyncBlock>();
    ZeroMemory(asyncBlock.get(), sizeof(*asyncBlock));
    asyncBlock->queue = queue;
    asyncBlock->context = this;
    asyncBlock->callback = [](XAsyncBlock* ab)
    {
        LOG_IF_FAILED(static_cast<User*>(ab->context)->RequestTokenComplete(ab));
        delete ab;
    };


    XUserGetTokenAndSignatureOptions options = XUserGetTokenAndSignatureOptions::None;

    if (forceRefresh)
    {
        WI_SET_FLAG(options, XUserGetTokenAndSignatureOptions::ForceRefresh);
    }

    static const XUserGetTokenAndSignatureHttpHeader headers[] =
    {
        { "Accept", "application/json"},
        { "Why", "Because"},
    };

    if (SUCCEEDED_LOG(XUserGetTokenAndSignatureAsync(
        _handle.get(),
        options,
        "GET",
        url,
        ARRAYSIZE(headers),
        headers,
        0,
        nullptr,
        asyncBlock.get())))
    {
        // The call succeeded, so release the std::unique_ptr ownership of XAsyncBlock* since the callback will take over ownership.
        // If the call fails, the std::unique_ptr will keep ownership and delete the XAsyncBlock*
        asyncBlock.release();
    }

    return S_OK;
}
```

## 요구 사항

**헤더:** XUser.h

**지원되는 플랫폼:** Windows, XBOX One 계열 콘솔 및 XBOX Series 콘솔

## 함께 보기

[XUser](/reference/system/xuser/xuser_members)

[XUserGetTokenAndSignatureAsync](/reference/system/xuser/functions/xusergettokenandsignatureasync)

[XUserGetTokenAndSignatureResult](/reference/system/xuser/functions/xusergettokenandsignatureresult)

[XUserGetTokenAndSignatureUtf16Async](/reference/system/xuser/functions/xusergettokenandsignatureutf16async)


## Related topics

- [XUserGetTokenAndSignatureUtf16Async](/ko/reference/system/xuser/functions/xusergettokenandsignatureutf16async.md)
- [XUserGetTokenAndSignatureUtf16Result](/ko/reference/system/xuser/functions/xusergettokenandsignatureutf16result.md)
- [XUserGetTokenAndSignatureUtf16ResultSize](/ko/reference/system/xuser/functions/xusergettokenandsignatureutf16resultsize.md)
- [XUserGetTokenAndSignatureAsync](/ko/reference/system/xuser/functions/xusergettokenandsignatureasync.md)
- [XUser](/ko/reference/system/xuser/xuser_members.md)
