---
title: "updateAutoSignInToken(_:updateContext:)"
framework: videosubscriberaccount
role: symbol
role_heading: Instance Method
path: "videosubscriberaccount/vsuseraccountmanager/updateautosignintoken(_:updatecontext:)"
---

# updateAutoSignInToken(_:updateContext:)

Sets the current Automatic Sign-In token.

## Declaration

```swift
func updateAutoSignInToken(_ newToken: String, updateContext: VSUserAccountManager.AutoSignInTokenUpdateContext) async throws
```

## Parameters

- `newToken`: The new token value to store in the person’s Apple Account. Your app determines the contents of this string using a mechanism you determine fitting to identify the account. In addition, ensure its value is of sufficient length, complexity, and security. For more information on setting this property, see doc://com.apple.videosubscriberaccount/documentation/VideoSubscriberAccount/VSAutoSignInToken/value.
- `updateContext`: The object the framework provides that reflects the person’s choice in the authorization prompt; pass the result of the doc://com.apple.videosubscriberaccount/documentation/VideoSubscriberAccount/VSUserAccountManager/requestAutoSignInAuthorization() method.

## Mentioned in

Signing people in to their media accounts automatically

## Discussion

Discussion Call this method when generating a new token value for an account. To update the token, request the person’s authorization for Automatic Sign-In. For more information, see requestAutoSignInAuthorization().

## See Also

### Signing people in automatically

- [VSUserAccountManager.AutoSignInToken](videosubscriberaccount/vsuseraccountmanager/autosignintoken-swift.struct.md)
- [VSUserAccountManager.AutoSignInTokenUpdateContext](videosubscriberaccount/vsuseraccountmanager/autosignintokenupdatecontext.md)
- [VSUserAccountManager.AutoSignInAuthorization](videosubscriberaccount/vsuseraccountmanager/autosigninauthorization.md)
- [autoSignInToken](videosubscriberaccount/vsuseraccountmanager/autosignintoken-swift.property.md)
- [deleteAutoSignInToken()](videosubscriberaccount/vsuseraccountmanager/deleteautosignintoken().md)
- [requestAutoSignInAuthorization()](videosubscriberaccount/vsuseraccountmanager/requestautosigninauthorization().md)
