# Access token is invalid for voice & video calls during sign in

**URL:** <https://community.sendbird.com/t/access-token-is-invalid-for-voice-video-calls-during-sign-in/2726>\
**Category:** iOS\
**Tags:** sendbird-call, call-sdk, ios\
**Created:** [July 23, 2021, 1:44pm UTC](https://community.sendbird.com/t/access-token-is-invalid-for-voice-video-calls-during-sign-in/2726 "2021-07-23T13:44:59Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ronit\_Patel](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/ronit_patel/32/1429_2.png) [@Ronit\_Patel](https://community.sendbird.com/u/Ronit_Patel)\
**Post date:** [July 23, 2021, 1:44pm UTC](https://community.sendbird.com/t/access-token-is-invalid-for-voice-video-calls-during-sign-in/2726/1 "2021-07-23T13:44:59Z")

</div>

**400302** **(InvalidAccessToken)**  
this error generates during the **sign in with ID** and and **app ID** where the signup does not generate the access token or how to generate access token?

---

<div class="post-metadata">

**Author:** ![Tyler](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/tyler/32/810_2.png) [@Tyler](https://community.sendbird.com/u/Tyler)\
**Post date:** [July 23, 2021, 1:55pm UTC](https://community.sendbird.com/t/access-token-is-invalid-for-voice-video-calls-during-sign-in/2726/2 "2021-07-23T13:55:50Z")

</div>

Hi @Ronit_Patel,

Welcome to the Sendbird Community. In order to generate an Access Token, you’d want do pass in `issue_access_token` as true in your user creation process. More specific information can be found here: [User | Chat Platform API | Sendbird Docs](https://sendbird.com/docs/chat/v3/platform-api/guides/user#2-create-a-user)

Let me know if that doesn’t work for you and we’ll dive a bit deeper.

---

<div class="post-metadata">

**Author:** ![Ronit\_Patel](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/ronit_patel/32/1429_2.png) [@Ronit\_Patel](https://community.sendbird.com/u/Ronit_Patel)\
**Post date:** [July 23, 2021, 2:13pm UTC](https://community.sendbird.com/t/access-token-is-invalid-for-voice-video-calls-during-sign-in/2726/3 "2021-07-23T14:13:53Z")

</div>

i have already go through the documents, i did not find any sign in method for get access token and sign in from demo call and documentation.

---

<div class="post-metadata">

**Author:** ![Tyler](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/tyler/32/810_2.png) [@Tyler](https://community.sendbird.com/u/Tyler)\
**Post date:** [July 23, 2021, 2:22pm UTC](https://community.sendbird.com/t/access-token-is-invalid-for-voice-video-calls-during-sign-in/2726/4 "2021-07-23T14:22:39Z")

</div>

You can not generate an access token on sign in. You must create it on user creation, or via an update call. Once you generated the access token, you can pass it during the sign in process to authenticate.

Can you confirm if you’ve generated the token for the user?

---

<div class="post-metadata">

**Author:** ![Ronit\_Patel](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/ronit_patel/32/1429_2.png) [@Ronit\_Patel](https://community.sendbird.com/u/Ronit_Patel)\
**Post date:** [July 24, 2021, 6:40am UTC](https://community.sendbird.com/t/access-token-is-invalid-for-voice-video-calls-during-sign-in/2726/5 "2021-07-24T06:40:04Z")

</div>

can you please provide more information how to signin for generate access token?

---

<div class="post-metadata">

**Author:** ![Tyler](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/tyler/32/810_2.png) [@Tyler](https://community.sendbird.com/u/Tyler)\
**Post date:** [July 24, 2021, 1:07pm UTC](https://community.sendbird.com/t/access-token-is-invalid-for-voice-video-calls-during-sign-in/2726/6 "2021-07-24T13:07:33Z")

</div>

@Ronit_Patel,

As explained above, you’ll need to first generate an access token for the user via the Platform API. Once you’ve generated the access token, you can sign in with that access token by passing it into your authenticate method.

```auto
class AppDelegate: UIResponder, UIApplicationDelegate {
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        SendBirdCall.configure(YOUR_APP_ID)

        // The USER_ID below should be unique to your Sendbird application.
        let params = AuthenticateParams(userId: USER_ID, accessToken: ACCESS_TOKEN)
        SendBirdCall.authenticate(with: params) { (user, error) in
            guard let user = user, error == nil else {
                // Handle error.
            }

            // The user has been authenticated successfully and is connected to Sendbird server.
            // Register device token by using the `SendBirdCall.registerVoIPPush` or `SendBirdCall.registerRemotePush` methods.
            ...
        }
    }
}

```
