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

# PFAuthenticationServerLoginWithPSNAsync

> PlayStation :tm: Network の認証コードを使用してユーザーをサインインさせ、認証済みユーザーを必要とする後続の API 呼び出しに使用できるセッション識別子を返します。

PlayStation :tm: Network の認証コードを使用してユーザーをサインインさせ、認証済みユーザーを必要とする後続の API 呼び出しに使用できるセッション識別子を返します。

## 構文

```cpp theme={null}
HRESULT PFAuthenticationServerLoginWithPSNAsync(  
    PFServiceConfigHandle serviceConfigHandle,  
    const char* secretKey,  
    const PFAuthenticationServerLoginWithPSNRequest* request,  
    XAsyncBlock* async  
)  
```

### パラメーター

**`serviceConfigHandle`**   PFServiceConfigHandle

PFServiceConfigCreateHandle 呼び出しから返される PFServiceConfigHandle。

**`secretKey`**   char\*\
*In\_z*

サービス リクエストの認証に使用するタイトル シークレット キー。

**`request`**   [PFAuthenticationServerLoginWithPSNRequest\*](https://docs.xbox.com/ja-jp/services/playfab/api-references/c/pfauthenticationtypes/structs/pfauthenticationserverloginwithpsnrequest.md)

値が設定されたリクエスト オブジェクト。

**`async`**   XAsyncBlock\*\
*Inout*

非同期操作用の XAsyncBlock。

### 戻り値

型: HRESULT

この API 操作の結果コード。

## 解説

この API は Windows で利用できます。ユーザーがその PlayStation :tm: Network アカウントで初めてサインインし、CreateAccount が true に設定されている場合、新しい PlayFab アカウントが作成され、PlayStation :tm: Network アカウントにリンクされます。この場合、PlayFab アカウントにはメールアドレスやユーザー名は関連付けられません。それ以外の場合、PlayStation :tm: Network アカウントにリンクされた PlayFab アカウントがなければ、その旨を示すエラーが返されるため、タイトルはユーザーに PlayFab アカウントの作成を案内できます。ServerLinkPSNAccountAsync、ServerUnlinkPSNAccountAsync も参照してください。非同期タスクが完了したら、[PFAuthenticationServerLoginWithPSNGetResult](https://docs.xbox.com/ja-jp/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationserverloginwithpsngetresult.md) を呼び出して結果を取得します。

## 要件

**ヘッダー:** PFAuthentication.h

## 関連項目

[PFAuthentication のメンバー](https://docs.xbox.com/ja-jp/services/playfab/api-references/c/pfauthentication/pfauthentication_members.md)


## Related topics

- [PFAuthenticationServerLoginWithPSNGetResultSize](https://docs.xbox.com/ja-jp/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationserverloginwithpsngetresultsize.md)
- [PFAuthenticationServerLoginWithPSNGetResult](https://docs.xbox.com/ja-jp/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationserverloginwithpsngetresult.md)
- [PFAuthenticationServerLoginWithXboxAsync](https://docs.xbox.com/ja-jp/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationserverloginwithxboxasync.md)
- [PFAuthenticationServerLoginWithCustomIDAsync](https://docs.xbox.com/ja-jp/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationserverloginwithcustomidasync.md)
- [PFAuthenticationServerLoginWithIOSDeviceIDAsync](https://docs.xbox.com/ja-jp/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationserverloginwithiosdeviceidasync.md)
