OfficeDev / microsoft-teams-library-js

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

Authentication Issue with Auth Url #2075

Open curtismalette-klyck opened 10 months ago

curtismalette-klyck commented 10 months ago

Hi everyone

I have ran into an issue with the authentication.authenticate portion of the app when trying to sign in specifically with the app version of microsoft teams.

When using the browser and app with local host and running an ngrok server, the popup successfully opens and my valid domains are working fine. However, when deployed to the server the authentication.authenticate function throws an error "Auth url is not valid". This error does not occur when running on the ngrok server and works for both browser and the app. The only time it does not work, is when it is deployed to the via the deployment center for azure web app service.

I used to receive this error when running localhost, however once I added the ngrok server url to the domain list and our app sign in url to the valid domain list in the manifest.json, the error went away and I was able to continue the external authentication.

I have tried added our azurewebsites.net url to the list as well as the botframework, plus any version of our own url with no luck.

I'm not sure if there is a specific url that needs to be added once you deploy to the server, however no documentation specifically mentions it. My assumption was the hostname for our azurewebsite.net, however that did not work either.

Any help is greatly appreciated.

nwojod-MSFT commented 10 months ago

@curtismalette-klyck thanks for reporting this issue. To help up investigate this, would you be willing to share your manifest file with us and what URL you are using for the auth call. We want to ensure we have all the necessary information to help in identifying the root cause.

curtismalette-klyck commented 10 months ago

Absolutely

I've attached the manifest file and my url for the auth call is below

https://app.klyck.io/auth/realms/mettler/protocol/openid-connect/auth?response_type=code&client_id=whut-frontend&redirect_uri=https://klyckio.azurewebsites.net/klyckIoMessageExtension/token.html

manifest.json

nwojod-MSFT commented 10 months ago

@curtismalette-klyck thanks for sharing the above info. We looked through your manifest and couldn't find anything obviously wrong. Can you confirm what version of teamsjs you are using and where in Teams you are running your app (web, mobile, desktop)? Also, is this for a compose extension?

TrevorJoelHarris commented 10 months ago

@curtismalette-klyck How did you deploy your app? Did you use Teams toolkit, upload it as a custom app through the Teams UI, submit it to the store, etc.

When you made this change to your manifest: image What steps did you take to resubmit your app?

nwojod-MSFT commented 10 months ago

@curtismalette-klyck so we tested and were able to get the auth URL to work. (Note - this is a tab app and not message extension.) This is a sample app we built. Can you please pull this app and test if it works on your end as well https://github.com/TrevorJoelHarris/AuthenticationTest. Thanks

curtismalette-klyck commented 10 months ago

@TrevorJoelHarris @nwojod-MSFT Apologies for the delayed response here.

What steps did you take to resubmit your app?

So our app is deployed using the deployment centre portion of the app service. It is automatically deployed when our bitbucket code is updated. This is the deployment to the store that we are having issues with, the custom app locally (pointing to ngrok) is the one we were able to get working. One thought I had on this was perhaps the manifest is not updated within the store?

Once the app is deployed to the store, it is working on the web but not the desktop app (I'm currently testing on mac)

Also, is this for a compose extension? Yes thats Correct

Can you confirm what version of teamsjs The npm package "@microsoft/teams-js": "2.15.0",

Can you please pull this app and test if it works on your end as well I wasn't able to access that link, it returns a 404.

TrevorJoelHarris commented 10 months ago

@curtismalette-klyck Sorry, that's my bad on the 404. If you try again it should be available now. Let me talk with some people over here about this extra information you just shared 👍

Meghana-MSFT commented 10 months ago

@curtismalette-klyck - Did you get a chance to test the above shared sample?