AzureAD / microsoft-authentication-library-for-js

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

msal-angular@2 logout request is cancelled #2898

Closed pcampospulsarsd closed 3 years ago

pcampospulsarsd commented 3 years ago

Library

Framework

Description

We are following the example in angular11-b2c-sample and having issues when we logout the user calling msalService.logout(), as we have observed the following is happening:

As we observe it to be different based on angular11-b2c-sample which we have updated to the library versions above, we are curious if there is any azure configuration that we might have missed? so far we have configured it as follows:

Notes:

Source

Thank you.

jo-arroyo commented 3 years ago

@pcampospulsarsd Can you clarify what you mean by calls cancelled? This is not expected behavior. Could you also provide your configurations and usage?

pcampospulsarsd commented 3 years ago

@jo-arroyo , thank you for the confirming that that is not the expected behaviour. With that information, we instead did the msal-angular integration part from the start and making sure it is aligned with the example of angular11-b2c-sample. At the same time revisited the azure configuration which is aligned with what is specified in the pre-requisites. With those parts reviewed, it is now working seamlessly.

This question can be marked as resolved for now, below would be the information on what we think caused the issue.

Can you clarify what you mean by calls cancelled?

  • The call to logout was aborted, the har file "response" for the postLogout is as follows :
    "response": {
    "status": 0,
    "statusText": "",
    "httpVersion": "",
    "headers": [],
    "cookies": [],
    "content": {
    "size": 0,
    "mimeType": "x-unknown"
    },
    "redirectURL": "",
    "headersSize": -1,
    "bodySize": -1,
    "_transferSize": 0,
    "_error": "net::ERR_ABORTED"
    }
  • Which we believe was due to the immediately succeeding call to authorize endpoint.

As for the cause, after investigating, it is likely caused by the code base having lots of listeners which have unchecked code inside which likely triggered the authorize endpoint to call an api.