Skip to content
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

Crash in OnpremiseUserCredentials #58

Open
wmertens opened this issue Oct 4, 2018 · 2 comments
Open

Crash in OnpremiseUserCredentials #58

wmertens opened this issue Oct 4, 2018 · 2 comments

Comments

@wmertens
Copy link

wmertens commented Oct 4, 2018

If the server returns an error, sometimes it doesn't send the authentication header. Here's an example response that triggers a crash in https://github.com/s-KaiNet/node-sp-auth/blob/master/src/auth/resolvers/OnpremiseUserCredentials.ts#L56

{
  "statusCode": 400,
  "body": "The length of the URL for this request exceeds the configured maxUrlLength value.",
  "headers": {
    "server": "Microsoft-IIS/8.5",
    "sprequestguid": "9f0c959e-449b-809b-6dd5-552e75b53cfc",
    "request-id": "9f0c959e-449b-809b-6dd5-552e75b53cfc",
    "x-frame-options": "SAMEORIGIN",
    "x-powered-by": "ASP.NET",
    "microsoftsharepointteamservices": "15.0.0.4841",
    "x-content-type-options": "nosniff",
    "x-ms-invokeapp": "1; RequireReadOnly",
    "date": "Thu, 04 Oct 2018 10:26:16 GMT",
    "content-length": "81"
  },
}
@s-KaiNet
Copy link
Owner

s-KaiNet commented Oct 4, 2018

Could you please elaborate?
From my understanding, if a server returns an error during the authentication phase, the process should be aborted.

@wmertens
Copy link
Author

wmertens commented Oct 4, 2018

Actually the problem is that the authentication header is missing in this response, and that will make the header parser throw an error, and then the original http error is gone.

I had to do some deep debugging to see that my url was too long...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants