Giter Site home page Giter Site logo

NO_AUTHORIZED error about tools HOT 27 CLOSED

agoraio avatar agoraio commented on August 15, 2024
NO_AUTHORIZED error

from tools.

Comments (27)

dongsettle avatar dongsettle commented on August 15, 2024 6

Web sdk 2.9.0 version has a known bug that will cause the token generated by string uid Unable to join channel successfully, the error message is NO_AUTHORIZED, we will fix this problem in the next version of sdk, you may need to use int uid temporarily To generate tokens to circumvent this problem, or you can use version 2.8.0 sdk

from tools.

plutoless avatar plutoless commented on August 15, 2024 3

@kush3107 it seems you are using a fixed uid 2882341273 and channel popo123 when calculating token. you need to ensure you are joining the same channel with same uid. The two repository you mentioned by default will use 0 as uid to join channel which means it will use a random uid.

from tools.

kush3107 avatar kush3107 commented on August 15, 2024 1

Hi @plutoless Thanks for all the help. I figured out the issue. I was using the same token for both users.

from tools.

plutoless avatar plutoless commented on August 15, 2024

so it works with int uid but not string uid?

from tools.

IG-88-2 avatar IG-88-2 commented on August 15, 2024

yes so basically when im replacing it to be string (uuid) it throws this error, when im chaning it back to number it fine again, what do you think could be the cause ?

from tools.

specc avatar specc commented on August 15, 2024

would be helpful if you can provide a link to 2.8.0 web sdk. I had to guess the link to download that version. All of your sdk download links point to the newest download.

from tools.

dongsettle avatar dongsettle commented on August 15, 2024

cdn link: https://cdn.agora.io/sdk/release/AgoraRTCSDK-2.8.0.js
download link: http://download.agora.io/sdk/release/Agora_Web_SDK_v2_8_0_FULL.zip

from tools.

kush3107 avatar kush3107 commented on August 15, 2024

I am getting this issue with version 3.0.0 also.

from tools.

plutoless avatar plutoless commented on August 15, 2024

@kush3107 please provide more details, you may have a real NO_AUTHORIZE issue.

from tools.

kush3107 avatar kush3107 commented on August 15, 2024

@plutoless I am using the same code from node samples to create the Dynamic Key.

app.get('/tt', [], (req: express.Request, res: express.Response) => {
    // Rtc Examples
    const appID = 'c3208e8e85b5499f89*********';
    const appCertificate = 'ce75e73599df48cbb15c*******';
    const channelName = 'popo123';
    const uid = 2882341273;
    const account = "2882341273";
    const role = RtcRole.PUBLISHER;

    const expirationTimeInSeconds = 3600;

    const currentTimestamp = Math.floor(Date.now() / 1000);

    const privilegeExpiredTs = currentTimestamp + expirationTimeInSeconds;

// IMPORTANT! Build token with either the uid or with the user account. Comment out the option you do not want to use below.

    const tokenA = RtcTokenBuilder.buildTokenWithUid(appID, appCertificate, channelName, uid, role, privilegeExpiredTs);
    console.log("Token With Integer Number Uid: " + tokenA);

// Build token with user account
    const tokenB = RtcTokenBuilder.buildTokenWithAccount(appID, appCertificate, channelName, account, role, privilegeExpiredTs);
    console.log("Token With UserAccount: " + tokenB);

    res.json({
        token: tokenA
    });
});

Broadcasting and joining the channel one are also the same code from the samples and they use the same app id and the token generated from the above the code.

Using this for broadcasting and this for joining the channel and receiving the stream

from tools.

specc avatar specc commented on August 15, 2024

I am getting this issue with version 3.0.0 also.

If I were you, stick with 2.8.0 I also found that after you are able to join with string as uid, there are other problems like subscriber event not triggering. Just stick with interger uid for now until they fix the issue.

from tools.

kush3107 avatar kush3107 commented on August 15, 2024

@specc I tried it with web sdk 2.8.0 also.

from tools.

kush3107 avatar kush3107 commented on August 15, 2024

@specc Also the I am getting the same token with both methods on the node server.

from tools.

kush3107 avatar kush3107 commented on August 15, 2024

@plutoless Ok thanks for the direction. I will double check it on my end

from tools.

kush3107 avatar kush3107 commented on August 15, 2024

Hi @plutoless The stream is now broadcasting for me, thanks for the help but now when I try to connect using this I cannot see the remote stream all I see is the local stream. Please tell me what details you need.

Thanks for the help in advance.

from tools.

specc avatar specc commented on August 15, 2024

Hi @plutoless The stream is now broadcasting for me, thanks for the help but now when I try to connect using this I cannot see the remote stream all I see is the local stream. Please tell me what details you need.

Thanks for the help in advance.

Like i said even if you are able to connect, the subscription event wont be triggered. You should use uid as integer then it should work.

from tools.

kush3107 avatar kush3107 commented on August 15, 2024

@specc I am using uid as integer and moreover I get the same value for tokenA or tokenB from the nodejs example. Also I am using "agora-rtc-sdk": "2.8.0" but still cannot see the remote stream on the one-to-one video example and this works fine when I use the token generated from agora console.

from tools.

plutoless avatar plutoless commented on August 15, 2024

just to clarify, you have two clients joining the same channel, and you won't be able to see each other? could you pls share the channel name and corresponding uid, plus your join channel time so that i can check backend?

from tools.

kush3107 avatar kush3107 commented on August 15, 2024

@plutoless

App Name on my account - new
App Id - c3208e8e85b5499f897db9d83f1b6f75
App Certificate - ce75e73599df48cbb15ca02abc1b6c10
Channel Name - popo123
UID - 2882341273
Expired Time - current timestamp + 3600s

from tools.

kush3107 avatar kush3107 commented on August 15, 2024

@plutoless The strange thing is that when I try to do this with the temp token generated from agora console everything works fine.

from tools.

plutoless avatar plutoless commented on August 15, 2024

@kush3107 i checked few backend cases and 2882341273 is the only user joined in channel. if you want to see remote stream you will need another client joining same channel.

from tools.

tayoraph avatar tayoraph commented on August 15, 2024

hi guys , please help. i m building a live broadcast with angular , was able to generate a token successfully from the host , but i m finding subscribing to the stream difficult . it is giving same issue NO_AUTHORIZE. My uid is integer

from tools.

tabish-ahmed avatar tabish-ahmed commented on August 15, 2024

I am also getting the same error @tayoraph

from tools.

tayoraph avatar tayoraph commented on August 15, 2024

from tools.

shuvro avatar shuvro commented on August 15, 2024

I am using this https://webdemo.agora.io/agora-web-showcase/examples/Agora-Web-Tutorial-1to1-Web/
to test. But it shows that NO_AUTHORISATION error.

from tools.

spektra2147 avatar spektra2147 commented on August 15, 2024

In this UI, need to pass UID which are available in the ADVANCED SETTINGS

from tools.

hkmsadek avatar hkmsadek commented on August 15, 2024

I am facing the same issue..

 const uid : number = 1235643434344;
  const role = RtcRole.PUBLISHER;
  const expirationTimeInSeconds = 3600
  const currentTimestamp = Math.floor(Date.now() / 1000)
  const privilegeExpiredTs = currentTimestamp + expirationTimeInSeconds
  const token = RtcTokenBuilder.buildTokenWithUid(appID, appCertificate, channelName, uid, role, privilegeExpiredTs);

And I am using same chanel name, uid and app id in frontend but getting agora-rtc-client.js?ea71:35 client join failed NO_AUTHORIZED

I am using vue.js sample code and it has package installed "agora-rtc-sdk": "^3.1.1",

Any help?

from tools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.