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

AgoraRTM client login failure RtmUnauthenticatedError: Error Code 5. Signature verification failed. #95

Closed
maheshpraj opened this issue Jul 28, 2020 · 6 comments

Comments

@maheshpraj
Copy link

maheshpraj commented Jul 28, 2020

When call login() return error.

          function logger() {
		//initialize client
		const client = AgoraRTM.createInstance(option.appID);
			//check connection state
		client.on('ConnectionStateChange', (newState, reason) => {
			console.log('on connection state changed to ' + newState + ' reason: ' + reason);
		});

		//generate new token
	$.post("@Url.Content("~/Agora/GetAgoraToken")", { "_Uid": "0" }, function (result) {
		console.log(result);
			mToken = result;
			client.login({ token: mToken, uid: mdNetUsertype.toString() }).then(function () {
				console.log('AgoraRTM client login success');
			}).catch(function (err) {
				console.log('AgoraRTM client login failure', err);
			});
		});
	}
@yoreland
Copy link
Contributor

Can you post your agora token generate code?

@maheshpraj
Copy link
Author

                var appCertificate = Agora_API_SECRET;//App certificate
		var uid = _Uid;
		uint _expiredTs = 0;
		AccessToken token = new AccessToken(apiKey, appCertificate, channelName, uid);
		token.addPrivilege(Privileges.kJoinChannel, _expiredTs);
		token.addPrivilege(Privileges.kPublishAudioStream, _expiredTs);
		token.addPrivilege(Privileges.kPublishVideoStream, _expiredTs);
		string strToken = token.build();
		return strToken;

@plutoless
Copy link
Contributor

we have a token builder class. maybe try using that.
check out the readme in this link: https://github.com/AgoraIO/Tools/tree/master/DynamicKey/AgoraDynamicKey/nodejs

@maheshpraj
Copy link
Author

Got the solution.

Thanks all for your contribution.

@zolotokrylin
Copy link

@maheshpraj what was the solution, please? We are facing this issue.

@aeq-dev
Copy link

aeq-dev commented Nov 20, 2021

I'm facing the same issue here
Any help @plutoless @maheshpraj ?

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

5 participants