MicrosoftDocs / msteams-docs

Source for the Microsoft Teams developer platform documentation.
https://aka.ms/teamsdev
Creative Commons Attribution 4.0 International
289 stars 513 forks source link

What are expected error in sso and how to mitigate them #3063

Open abdulkareemnalband opened 3 years ago

abdulkareemnalband commented 3 years ago

We are getting following error with SSO with our multi tenant application

  1. tokenRevoked
  2. renewalTimeout
  3. unknownAuthError

Where can i find documentation for above and try to mitigate them


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ghost commented 3 years ago

Hi abdulkareemnalband! Thank you for bringing this issue to our attention. We will investigate and if we require further information we will reach out in one business day. Please use this link to escalate if you don't get replies.

Best regards, Teams Platform

marwalsch commented 3 years ago

As for the renewalTimeout you might want to check Issue #532 of the Teams SDK. It appears this is an issue on the Teams client's site which can be avoided by re-install. Has the getAuthToken() API worked for you before or are you experiencing the issue on random occasions?

Sridevi-MSFT commented 3 years ago

@abdulkareemnalband, Thanks for brining up this issue, Taking this for internal discussion with team and will update you.

abdulkareemnalband commented 3 years ago

@marwalsch getAuthToken() is working for us

Above are some error we caught in our analytics where some customers are getting it

Sridevi-MSFT commented 3 years ago

@abdulkareemnalband , Have you gone through this documentation.

abdulkareemnalband commented 3 years ago

@Sridevi-MSFT that page does not mention anything about erros

dmcweeney commented 3 years ago

It is still happening for us randomly - restarting Teams seems to be the only reliable solution. It would be nice to have some debugging steps outlined to help trace the source of the problem,

ascott18 commented 3 years ago

ssoAcquireTokenRenewFailed is an error that we've seen happen if the user hasn't used the app before and has to be prompted for consent. If the user clicks "cancel" on the popup request for OAuth permissions that appears, this is the error that failureCallback is called with.

abdulkareemnalband commented 3 years ago

@ascott18 thanks

ascott18 commented 3 years ago

Have you gone through this documentation.

@Sridevi-MSFT the docs you linked are for LinkedIn and do nothing more than describe the very basic workings of OAuth2. How is this in any way applicable to Teams SSO?

Nikitha-MSFT commented 3 years ago

Are you running fiddler in the back-end? Could you please conform?

abdulkareemnalband commented 3 years ago

No fiddler, proxy or vpn I'm running it on directly

Nikitha-MSFT commented 3 years ago

The renewalTimeout error is returned from our auth stack. could you please share some Teams logs showing this error being returned so we can investigate further. Also, we have noticed that WAM and Fiddler don’t get along so when you’re running Fiddled the getAuthToken calls fail with renewalTimeout error

ghost commented 3 years ago

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 3 days. It will be closed if no further activity occurs within 3 days of this comment.

ascott18 commented 3 years ago

@Nikitha-MSFT @Sridevi-MSFT Why is this closed? The original question about what the different errors from SSO are and how they should be handled by developers has not been answered.

ghost commented 3 years ago

Hi abdulkareemnalband! Thank you for bringing this issue to our attention. We will investigate and if we require further information we will reach out in one business day. Please use this link to escalate if you don't get replies.

Best regards, Teams Platform

ghost commented 3 years ago

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 3 days. It will be closed if no further activity occurs within 3 days of this comment.

ascott18 commented 3 years ago

@Nikitha-MSFT @Sridevi-MSFT Sorry, still not resolved. Might want to remove the needs-author-feedback so the bot doesn't close it again.

ghost commented 3 years ago

Hi abdulkareemnalband! Thank you for bringing this issue to our attention. We will investigate and if we require further information we will reach out in one business day. Please use this link to escalate if you don't get replies.

Best regards, Teams Platform

Githamza commented 3 years ago

ssoAcquireTokenRenewFailed is an error that we've seen happen if the user hasn't used the app before and has to be prompted for consent. If the user clicks "cancel" on the popup request for OAuth permissions that appears, this is the error that failureCallback is called with.

I get the same error , How have you made to resolve it ?

PodgeHeavin commented 3 years ago

What causes the tokenRevoked error. Causing issues in our tab application for teams

ChetanSharma-msft commented 3 years ago

We have informed engineering team on this issue and they are checking on it.

ChetanSharma-msft commented 2 years ago

@surbhigupta12 - Could you please help us to update the contents like below: tokenRevoked: Token has expired and need to renew it. renewalTimeout: Token has expired and can not renew it, so needs to generate a new token.

Thanks!!

tiennguyen1293 commented 2 years ago

I'm facing with issue unknownAuthError.

ChetanSharma-msft commented 2 years ago

@tiennguyen1293 - Thanks for reporting this issue. Can you please share the repro steps or minimal code, so that we can try it from our end?

tiennguyen1293 commented 2 years ago

@ChetanSharma-msft, I have registered the Teams App on Azure Portal exactly as the DOC steps mentioned.

https://docs.microsoft.com/en-us/microsoftteams/platform/tabs/how-to/authentication/tab-sso-overview

Then I configure the Teams App as below

Screen Shot 2022-06-30 at 17 11 14

and code

    microsoftTeams.initialize()
    microsoftTeams.authentication.getAuthToken({
      successCallback: function (response) {
        console.log('=== successCallback', response)
        failureCallback()
      },
      failureCallback: function (reason) {
        console.log('=== failureCallback', reason)
        failureCallback()
      },
    })

and then response error

image