1

I have integrated ADAL.js in my Dynamics CRM tenant. It was working with login prompt but sudden I am getting this message while trying to login:

Learning Path error: SecurityError: Blocked a frame with origin "https://tenant-test.crm6.dynamics.com" from accessing a cross-origin frame.

and here is my adal.js config code:

   var adalConfig = {
        clientId: APPID,
        popUp: true,
        cacheLocation: "localStorage",
        redirectUri: "https://tenant-test.crm6.dynamics.com/"
    };
    adalAuthContext = new window['AuthenticationContext'](adalConfig);

    var user = adalAuthContext.getCachedUser();
    if (!user) {
        adalAuthContext.login();
    }
user10496245
  • 181
  • 1
  • 11

1 Answers1

0

You cannot access an with different origin using JavaScript, as doing so would be a major security risk. For same-origin policies, browsers block scripts trying to access a frame with a different origin.

As a workaround, you can use windows.postMessage to send messages between pages or disable the same-origin policy in your browser.

See the full explanation here: SecurityError: Blocked a frame with origin from accessing a cross-origin frame

Marilee Turscak - MSFT
  • 5,874
  • 2
  • 15
  • 25