Extension/webpart fails to authenticate to Azure in Teams native app
Category
- [ ] Question
- [ ] Typo
- [x] Bug
- [ ] Additional article idea
Expected or Desired Behavior
As running an spfx solution we should be able to authenticate to Azure in the Teams native app the same way we are being able to authenticate when in the web app or in SharePoint
Observed Behavior
We have a spfx extension/webpart which makes a call to Azure and authenticates through the aadHttpClient. It works in SharePoint, it works in an iframed page in Teams web app BUT when in the native desktop app it fails to authenticate.
Error message Error: AADSTS50058: A silent sign-in request was sent but no user is signed in. The cookies used to represent the user's session were not sent in the request to Azure AD. This can happen if the user is using Internet Explorer or Edge, and the web app sending the silent sign-in request is in different IE security zone than the Azure AD endpoint (login.microsoftonline.com). Trace ID: 4b309bad-9ed0-4590-bddb-7986fdc62800 Correlation ID: 1e6c7de5-3086-4f7a-9ed7-04644e5c4994 Timestamp: 2019-05-16 19:42:15Z
This is ONLY happening in the native app. I looked everywhere to try to find a solution to fix this but can't find a solution.
I talked to @srideshpande at the SPC19 where he asked me to raise the issue here for him to take a look.
Thanks Magnus
Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.
@lucabandMSFT - can you point to the manual steps to get the flows working? I'm assuming that once those steps are done, this should work.
yes @patmill @MagtheRag : can you please check if the following steps would help you? (note that this is a workaround to unblock you while we are rolling the right fix to the service that will not require you to do this in the future):
Note: you have to be Global Tenant Administrator to perform all the steps below
Step 1. Visit the "Manage Permissions" Page in SharePoint Tenant Admin Step 2. Go to -> https://aad.portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredAppsPreview Step 3. Click on "SharePoint Online Client Extensibility" Web Application Principal Step 4. Click Manifest on the left menu Step 5. Copy the id from the oAuth2Permission array "oauth2Permissions": [ { "adminConsentDescription": "Allow the application to access SharePoint Online Client Extensibility Web Application Principal on behalf of the signed-in user.", "adminConsentDisplayName": "Access SharePoint Online Client Extensibility Web Application Principal", "id": "2143704b-186b-4210-b555-d03aa61823cf", "isEnabled": true, "lang": null, "origin": "Application", "type": "User", "userConsentDescription": "Allow the application to access SharePoint Online Client Extensibility Web Application Principal on your behalf.", "userConsentDisplayName": "Access SharePoint Online Client Extensibility Web Application Principal", "value": "user_impersonation" } ],
Step 6. Replace “preAuthorizedApplications” entry with the following json
"preAuthorizedApplications": [ { "appId": "00000003-0000-0ff1-ce00-000000000000", "permissionIds": [ "2143704b-186b-4210-b555-d03aa61823cf" ] } ], Step 7. Hit Save. Thanks, Luca
Thanx @lucabandMSFT .. this worked after some hours and testing ..
@MagtheRag , happy to hear that. I'm going to close this issue.
Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues