AzureAD / microsoft-authentication-library-for-js

Microsoft Authentication Library (MSAL) for JS
http://aka.ms/aadv2
MIT License
3.66k stars 2.65k forks source link

Onenote addin + React + Edge, I dont signin loginPopup method #1031

Closed nakawankuma closed 4 years ago

nakawankuma commented 5 years ago

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Other... Please describe:

Browser:

Library version


Library version: .1.1.3

Current behavior

I use Msal in Onenote addin. Onenote addin is app on iframe . My app use loginPopup method. Chrome is signin and auto close window. althought have window with white screen that not display signin screen incase of Edge browser .

Expected behavior

open window and move signin(choose) screen.

Minimal reproduction of the problem with instructions

onGetToken() {
    const requestObj = {
        scopes: ["user.read", "Files.ReadWrite"]
    };

    myMSALObj.acquireTokenPopup(requestObj)
        .then((response1) => {
           --snip--
        })
        .catch(() => {
            myMSALObj.loginPopup(requestObj)
                .then((response2) => {
                })
                .catch((x2) => {
                });
        });
}
nakawankuma commented 5 years ago

I found incident location that about 930 line in UserAgentApplication.ts

that's "navigateWindow.location.replace(urlNavigate);" Edge does not implement "navigateWindow.location.replace" member in iframe window.

I think to trouble in openWindow + navigete.replace that open and navigate method.

"acquireTokenAuthority.resolveEndpointsAsync" I moved open popup block to urlNavigate declared next line. in about 525 line UserAgentApplication.ts const urlNavigate = UrlUtils.createNavigateUrl(serverAuthenticationRequest) + Constants.response_mode_fragment;

when open and signin screen(!!!). but I get error message "Nonce is not matching" I think change Nonce matching logic that change it diffcult by me.

nakawankuma commented 5 years ago

it see with https://github.com/AzureAD/microsoft-authentication-library-for-js/issues/1006

nakawankuma commented 5 years ago

It works fine with Chrome.

jasonnutter commented 5 years ago

@nakawankuma Thanks for the information, we'll take a look. We are already working on improving the functionality of our library when used in iframes, and we're aware of some issues with about:blank that we will be investigating. FYI @pkanher617 @sameerag

jasonnutter commented 4 years ago

@nakawankuma Can you please let us know if this is still an issue in 1.2.0?

tnorling commented 4 years ago

Closing due to inactivity. Let us know if this is still an issue.