Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid token #249

Closed
tapannathvani opened this issue Nov 26, 2020 · 13 comments
Closed

Invalid token #249

tapannathvani opened this issue Nov 26, 2020 · 13 comments

Comments

@tapannathvani
Copy link

Describe the bug

We are trying to create recording for one to one person.

  1. We are calling an API to our server
  2. Server generates token, sid, resourceid & uid and send back to front end
  3. we are passing the same data to joinchannel method.

Still we are getting invalid token error

Expected behavior

It should work like from Android to iOS and vice versa. Recording should be stored at our amazon s3 server

Desktop (please complete the following information):

  • iOS 12.2

Smartphone (please complete the following information):

  • iPhone 5s
@yoreland
Copy link
Contributor

Are you using RESTful API from your backend server side?
If possible, can you post your RESTful API request and response here? (for sure you could remove your token, id , etc)

@tapannathvani
Copy link
Author

As of now i can say that we are following this documentation : https://docs.agora.io/en/cloud-recording/restfulapi

Once our server guys call start api then they will give us the token, resourceid, uid & sid and then we called join channel method from iOS & Android side.

@tapannathvani
Copy link
Author

Hey 1 more doubt, like every members need to create separate token or all the members should use the same token and can join the channel with the same token?

@tapannathvani
Copy link
Author

We are able to store the file at amazon s3 server but its only 112 Byte file even though we use the app 3-4 mins. Just 1 more question that should we need to create sid & resource id for the all joinee or only for 1?

@plutoless
Copy link
Contributor

@tapannathvani you should generate separate token for different users, this will be safer.
depending on whether you will use individual/composite recording, you can use individual recording + subscribeVideoUids property to decide multiple users in one channel that you would like to record. or you can use composite mode + transcoding configs to merge multiple user's video into one.

@tapannathvani
Copy link
Author

Thanks for the response.
A teacher joined the channel with his userId (i.e. 111) and we created a token with that id also.
A student joined the channel with his userid (i.e 222) and we created a token with that id also.

Now We called acquire method where we are passing a unique random uid (which is not the same as above 2) and generated a resourceId.
Now we called Start API with the same uid which we have used in acquire api.
Teacher gets the error NOT AUTHORIZED even he is passing the same data like 1 (separate token, his uid (111) and the same channel name which is being used in all the scenarios)

Can you please help here if we are doing something wrong

@plutoless
Copy link
Contributor

@tapannathvani sorry for late reply
in which step did teacher get NOT_AUTHORIZED error?

@tapannathvani
Copy link
Author

When he joins the channel? when he clicked on Join the channel.. we are generating a token for him with his uid.. and at that time we are calling acquire & start recording method also (with a unique id not the same as teacher or student) and he sees NOT_AUTHORIZED error in console

@yoreland
Copy link
Contributor

Sorry for late response. If possible can you provide your request json for checking?

@plutoless
Copy link
Contributor

@tapannathvani could you pls help provide the full console logs? and could you pls help provide a token you generated so that we can help verify? many thanks

@tapannathvani
Copy link
Author

Hey that issue solved.. Thanks for the response

@tianminggh
Copy link

Hey that issue solved.. Thanks for the response

Can you tell me how you solved it, I also encountered the same problem

@tapannathvani
Copy link
Author

you are getting invalid token error or other one? if its invalid token then make sure UID should be the same which you are using to generate the token and channel name should be the same also..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants