OfficeDev / microsoft-teams-library-js

JavaScript library for use by Microsoft Teams apps
https://docs.microsoft.com/microsoftteams/platform/
Other
430 stars 199 forks source link

Failing to fetch token for userID provided by Teams Authenticator #2501

Open priytosh-tripathi opened 1 month ago

priytosh-tripathi commented 1 month ago

We're getting multiple instances where the userId provided by the function in teamsjs library, named microsoftTeams.authentication.getUser() fails to get a valid token from another function named microsoftTeams.authentication.getAuthToken() in the same session.

Teamsjs library version - 2.22.0

AE-MS commented 1 month ago

We're getting multiple instances where the userId provided the function in teamsjs library, named microsoftTeams.authentication.getUser() fails to get a valid token from another function named microsoftTeams.authentication.getAuthToken() in the same session.

Teamsjs library version - 2.22.0

Thanks for reporting this, @priytosh-tripathi. Are there any errors or rejected promises returned when you run this?

If you are able, can you please collect teamjs logs when you repro the problem so I can review them? Thanks!

priytosh-tripathi commented 1 month ago

Some of the common Error Messages and their frequencies are as below:

  1. "PayloadAdditionalData": Teams token retrieval failure: Error: Failed to get auth token. Token is empty due to auth provider library error., "count": 12502

  2. "Payload_AdditionalData": Teams token retrieval failure: Error: Error: Unexpected {"Description":"(pii)","Domain":"com.microsoft.oneauth","ErrorCode":"1001","Message":"An unexpected error occurred.","SystemErrorCode":"3489661028","Tag":"7q6ch","Type":"OneAuth","additional_query_parameters_count":"1","all_error_tags":"7q6ch|7q6ch","api_error_code":"3489661028","api_errorcontext":"(pii)","api{Location}}, "count": 1290

  3. "Payload_AdditionalData": Teams token retrieval failure: Error: Error: Unexpected {"Description":"(pii)","Domain":"com.microsoft.oneauth","ErrorCode":"1001","Message":"An unexpected error occurred.","SystemErrorCode":"2147943811","Tag":"4wbr5","Type":"OneAuth","additional_query_parameters_count":"1","all_error_tags":"4wbr5|4wbr5","api_error_code":"2147943811","api_errorcontext":"(pii)","api{Location}}, "count": 510

  4. "Payload_AdditionalData": Teams token retrieval failure: Error: Error: ApiContractViolation {"Description":"(pii)","Domain":"com.microsoft.oneauth","ErrorCode":"2400","Message":"The operation attempted is invalid.","SystemErrorCode":"2156265473","Tag":"7q6cd","Type":"OneAuth","additional_query_parameters_count":"2","all_error_tags":"7q6cd|7q6cd","api_error_code":"2156265473","api_errorcontext":"(p{Location}}, "count": 346

AE-MS commented 1 month ago

These errors appear to be coming from OneAuth library used by Teams. I'll let the Teams developer support folks investigate further. FYI @Wajeed-msft

priytosh-tripathi commented 1 month ago

Hi @AE-MS / @Wajeed-msft ,

A gentle query about if we have an update on this?

priytosh-tripathi commented 1 month ago

Hi @AE-MS / @Wajeed-msft ,

Do we have some update on this?

Nivedipa-MSFT commented 1 month ago

@priytosh-tripathi - Apologies for the delay. We will test this and update you soon.

priytosh-tripathi commented 1 month ago

Sure thing @Nivedipa-MSFT - Thanks for the update!

Nivedipa-MSFT commented 1 month ago

@priytosh-tripathi - Could you please share your code snippet and repro video to try at our end?

priytosh-tripathi commented 1 month ago

@Nivedipa-MSFT I have sent you message async regarding this issue. Please let me know the specific logs you need. It isnot possible to repro this so I am unable to share video.

Nivedipa-MSFT commented 1 month ago

@priytosh-tripathi - We are checking this with engineering team, we will let you know once we get any input from them.

priytosh-tripathi commented 2 weeks ago

Hi @Nivedipa-MSFT , We're blocked on the progress of this bug. Can you please let us know some tentative ETA / Progress ?

priytosh-tripathi commented 1 week ago

Hi @Nivedipa-MSFT ,

Another gentle reminder, on the incident

Nivedipa-MSFT commented 1 week ago

@priytosh-tripathi - Apologies for the delay. We are still checking this with engineering team, we will update you soon.