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

authentication.getAuthToken throwing generic vague error messages #2239

Open
alexchaaan opened this issue Mar 28, 2024 · 7 comments
Open

authentication.getAuthToken throwing generic vague error messages #2239

alexchaaan opened this issue Mar 28, 2024 · 7 comments

Comments

@alexchaaan
Copy link

Hi Team,

We were hoping to get more clarity around some of the error messages we're seeing with some authentication.getAuthToken() calls. This is causing our app to have an infinite loader as we're always expecting the jwt token to exist. This call works almost all of the time but we're seeing some errors with some users. Here's a list of some different errors we're seeing:

@jekloudaMSFT
Copy link
Contributor

Hi @alexchaaan, thanks for raising this. Can I know what platform you're seeing these issues on? Is this specific to Teams Classic or Teams Modern?

@Vaibhav-MSFT
Copy link

Hi @alexchaaan ,
Can you please let us know if you are trying to run any Microsoft Teams App development samples and can you provide us with some repro steps?

@alexchaaan
Copy link
Author

alexchaaan commented Apr 2, 2024

@jekloudaMSFT this is from our logs from some customers, not sure if it's classic or modern but I imagine mostly modern

@Vaibhav-MSFT unfortunately this is from our app in prod. here's the code that's logging the errors:


export function getTeamsJwt(): Promise<string> {
	return authentication.getAuthToken();
}
	useEffect(() => {
		const loadToken = async () => {
			try {
				const jwtToken = await getTeamsJwt();
				setJwtToken(jwtToken);
			} catch (err) {
				setIsLoading(false);
				throw err;
			}
		};
		loadToken().catch(error => {
			datadogLogs.logger.error('Error in TeamsAuthWrapper loadToken', {}, error);
			calmLogger.error('Error in TeamsAuthWrapper loadToken', {}, error);
		});
	}, []);

and this is a component thats rendered after the sdk is initialized

@Vaibhav-MSFT
Copy link

Hello @alexchaaan ,
Check that the client credentials (such as client ID, client secret, or certificate) used to authenticate your app are correct. Ensure that the credentials are properly configured in your app registration in Azure Active Directory (Azure AD).
Also Verify that your app registration in Azure AD has the necessary permissions.

@alexchaaan
Copy link
Author

@Vaibhav-MSFT this works for most users. it for sure works on our own tenant. if the credentials and app registration were wrong, wouldn't it fail every time?

@alexchaaan
Copy link
Author

alexchaaan commented Apr 8, 2024

bump
what could be the causes of that function failing sometimes?

@Vaibhav-MSFT
Copy link

We are checking your query with engineering team and let you know once we get any updates from them. Thanks.

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

No branches or pull requests

4 participants