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

# PFEntityTokenRefreshedEventHandler

> A handler invoked every time an Entity is automatically re-authenticated, thus obtaining a new EntityToken. An entity will be automatically re-authenticated.

A handler invoked every time an Entity is automatically re-authenticated, thus obtaining a new EntityToken. An entity will be automatically re-authenticated prior to its EntityToken expiring.

## Syntax

```cpp theme={null}
void PFEntityTokenRefreshedEventHandler(  
    void* context,  
    const PFEntityKey* entityKey,  
    const PFEntityToken* newToken  
)  
```

### Parameters

**`context`**   void\*

Optional context pointer to data used by the event handler.

**`entityKey`**   [PFEntityKey\*](https://docs.xbox.com/services/playfab/api-references/c/pftypes/structs/pfentitykey-c.md)

The EntityKey for the Entity whose EntityToken expired.

**`newToken`**   [PFEntityToken\*](https://docs.xbox.com/services/playfab/api-references/c/pfentity/structs/pfentitytoken.md)

The new token for the refreshed entity.

### Return value

Type: void

## Requirements

**Header:** PFEntity.h

## See also

[PFEntity members](https://docs.xbox.com/services/playfab/api-references/c/pfentity/pfentity_members.md)


## Related topics

- [PFEntityRegisterTokenRefreshedEventHandler](https://docs.xbox.com/services/playfab/api-references/c/pfentity/functions/pfentityregistertokenrefreshedeventhandler.md)
- [Services C API overview - PFEntity.h](https://docs.xbox.com/services/playfab/api-references/c/pfentity/pfentity_members.md)
- [PFEntityUnregisterTokenRefreshedEventHandler](https://docs.xbox.com/services/playfab/api-references/c/pfentity/functions/pfentityunregistertokenrefreshedeventhandler.md)
- [PFEntityTokenExpiredEventHandler](https://docs.xbox.com/services/playfab/api-references/c/pfentity/functions/pfentitytokenexpiredeventhandler.md)
- [PFEntityRegisterTokenExpiredEventHandler](https://docs.xbox.com/services/playfab/api-references/c/pfentity/functions/pfentityregistertokenexpiredeventhandler.md)
