-
Notifications
You must be signed in to change notification settings - Fork 204
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.authenticate is producing error cancelled by User on call #12193
Comments
Hi, @ShubhamSengar29 , which template are you using? You can try moving the authentication.authenticate logic to a button click event. This would prevent browser from automatically blocking pop-ups, which may caused the issue. |
Hi SLdragon, |
There is an issue maybe related to your scenario, you can take look and check whether teamsjs lib correct: OfficeDev/microsoft-teams-library-js#1779 |
Issue description is same as I have also found the same in debugging but the solution is not correct as I have checked my index.html and node-modules. below is the code used in live application -
In my new application, it's defined as promise method. So i am using the current way but for both the issue is there. |
Which library was updated recently? Also, what is the version of msal-browser in the auth-start.html page? A version conflict could be causing this issue. |
Teams-js library was updated. in our scheduled scan, whenever we get any vulnerabilities,we have to update that library. |
Could you share teams-js and msal-browser version used in your project? |
In live app - In new app - do we need msal-browser to run on local. in live app, only one msal-browser is in azure and we are not using azure for our app. |
Hi, @ShubhamSengar29 , can you share your demo project which can repro this issue, so that we take a try? |
Hi @SLdragon, |
I am using teams-js library to perform SSO (single sign on) for the user using authentication.authenticate method and when i call the url and pop-up opens. when i perform the operation, in authend component, i have written authentication.notifySuccess method. when the process comes here, pop-up closes and in promise method of authenticate, it should perform callback but it calls catch method with error -
error is: Error: CancelledByUser
at g (authentication.ts:519:1)
at authentication.ts:407:1
I have tried debugging it and issue comes from the library files.
Expected behavior
When popup closes and then method should be called and user should be redirected to configured page.
`app.initialize().then(() => {
authentication
.authenticate({
url: url,
width: 600,
height: 535,
})
.then((result) => {
console.log("pop up is opened", +result);
window.location.assign(sCallbackUrl);
})
.catch((reason) => {
console.log("error is:", reason);
// window.location.assign(sCallbackUrl);
// console.error(JSON.stringify(reason));
// console.log(JSON.stringify(reason));
}).finally(()=>{
});`
VS Code Extension Information (please complete the following information):
The text was updated successfully, but these errors were encountered: