Skip to content

SharePoint online authentication failed - Used username and password to authenticate using node js in Azure Function #122

Description

@ranjinie

i am getting errors when I try to connect to SharePoint from Visual studio code using node js and Azure Function. Please advise how to resolve this issue. thank you,
[error] Worker 49137137-f7de-4769-8170-1bc0d01f5abc uncaught exception (learn more: https://go.microsoft.com/fwlink/?linkid=2097909 ): Error: <s:Fault> <s:Code>

<s:Value>s:Sender</s:Value>     <s:Subcode>       <s:Value xmlns:a="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">a:FailedAuthentication</s:Value>    

</s:Subcode> </s:Code> <s:Reason> <s:Text xml:lang="en-US">ID3242: The security token could not be authenticated or authorized.</s:Text> </s:Reason> </s:Fault> at C:\APM_D365\AzureFunction\APMS\node_modules\node-sp-auth\lib\src\utils\AdfsHelper.js:31:23 at processTicksAndRejections (node:internal/process/task_queues:96:5)

[2023-01-23T23:54:20.749Z] Exception encountered while listening to EventStream

[2023-01-23T23:54:20.750Z] Language Worker Process exited. Pid=35896.

[2023-01-23T23:54:20.750Z] System.Private.CoreLib: The request stream was aborted. The HTTP/2 connection faulted. System.Private.CoreLib: An existing connection was forcibly closed by the remote host. Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets: An existing connection was forcibly closed by the remote host.

[2023-01-23T23:54:20.751Z] node exited with code 1 (0x1). LanguageWorkerConsoleLog[error] Worker 49137137-f7de-4769-8170-1bc0d01f5abc uncaught exception (learn more: https://go.microsoft.com/fwlink/?linkid=2097909 ): Error: <s:Fault> <s:Code> <s:Value>s:Sender</s:Value> <s:Subcode> <s:Value xmlns:a="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">a:FailedAuthentication</s:Value> </s:Subcode> </s:Code> <s:Reason> <s:Text xml:lang="en-US">ID3242: The security token could not be authenticated or authorized.</s:Text> </s:Reason> </s:Fault> at C:\APM_D365\AzureFunction\APMS\node_modules\node-sp-auth\lib\src\utils\AdfsHelper.js:31:23 at processTicksAndRejections (node:internal/process/task_queues:96:5).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions