> ## 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.

# PFAuthenticationServerLoginWithAndroidDeviceIDAsync

> Signs the user in using the Android device identifier, returning a session identifier that can subsequently be used for API calls which require an authenticated user

Signs the user in using the Android device identifier, returning a session identifier that can subsequently be used for API calls which require an authenticated user

## Syntax

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

### Parameters

**`serviceConfigHandle`**   PFServiceConfigHandle

PFServiceConfigHandle returned from PFServiceConfigCreateHandle call.

**`secretKey`**   char\*<br />*In\_z*

Title Secret Key used to authenticate the service request.

**`request`**   [PFAuthenticationServerLoginWithAndroidDeviceIDRequest\*](/services/playfab/api-references/c/pfauthenticationtypes/structs/pfauthenticationserverloginwithandroiddeviceidrequest)

Populated request object.

**`async`**   XAsyncBlock\*<br />*Inout*

XAsyncBlock for the async operation.

### Return value

Type: HRESULT

Result code for this API operation.

## Remarks

This API is available on Windows. On Android devices, the recommendation is to use the Settings.Secure.ANDROID\_ID as the AndroidDeviceId, as described in this blog post ([http://android-developers.blogspot.com/2011/03/identifying-app-installations.html](http://android-developers.blogspot.com/2011/03/identifying-app-installations.html)). More information on this identifier can be found in the Android documentation ([http://developer.android.com/reference/android/provider/Settings.Secure.html](http://developer.android.com/reference/android/provider/Settings.Secure.html)). If this is the first time a user has signed in with the Android device and CreateAccount is set to true, a new PlayFab account will be created and linked to the Android device ID. In this case, no email or username will be associated with the PlayFab account. Otherwise, if no PlayFab account is linked to the Android device, an error indicating this will be returned, so that the title can guide the user through creation of a PlayFab account. Please note that while multiple devices of this type can be linked to a single user account, only the one most recently used to login (or most recently linked) will be reflected in the user's account information. We will be updating to show all linked devices in a future release. When the asynchronous task is complete, call [PFAuthenticationServerLoginWithAndroidDeviceIDGetResult](/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationserverloginwithandroiddeviceidgetresult) to get the result.

## Requirements

**Header:** PFAuthentication.h

## See also

[PFAuthentication members](/services/playfab/api-references/c/pfauthentication/pfauthentication_members)
