ahaenggli / AzureAD-LDAP-wrapper

LDAP-Wrapper for 'microsoft 365' work or school accounts/users (former 'office 365' - via Entra ID, former AzureAD without AADDS)
https://ahaenggli.github.io/AzureAD-LDAP-wrapper/
MIT License
121 stars 30 forks source link

401 error #46

Closed ITC-KEDA closed 1 year ago

ITC-KEDA commented 1 year ago

Hi

i got this error: server.js ----> AzureAD-LDAP-wrapper version: 1.8.2 ERROR: 2023-03-17T22:53:04.011Z: ldapwrapper.js ClientAuthError: network_error: Network request failed. Please check network trace to determine root cause. | Fetch client threw: Error: HTTP status code 401 | Attempted to reach: https://login.microsoftonline.com/XXXXXXXX-XXXX-XXXX-XXXX-be5a5f040acb/oauth2/v2.0/token at ClientAuthError.AuthError [as constructor] (/app/node_modules/@azure/msal-common/dist/index.cjs.js:509:24) at new ClientAuthError (/app/node_modules/@azure/msal-common/dist/index.cjs.js:811:28) at Function.ClientAuthError.createNetworkError (/app/node_modules/@azure/msal-common/dist/index.cjs.js:854:16) at NetworkManager. (/app/node_modules/@azure/msal-common/dist/index.cjs.js:3428:51) at step (/app/node_modules/@azure/msal-common/dist/index.cjs.js:79:23) at Object.throw (/app/node_modules/@azure/msal-common/dist/index.cjs.js:60:53) at rejected (/app/node_modules/@azure/msal-common/dist/index.cjs.js:51:65) at processTicksAndRejections (node:internal/process/task_queues:96:5) { errorCode: 'network_error', errorMessage: 'Network request failed. Please check network trace to determine root cause. | Fetch client threw: Error: HTTP status code 401 | Attempted to reach: https://login.microsoftonline.com/a50e162b-4c36-4fce-bcce-be5a5f040acb/oauth2/v2.0/token', subError: ''

ahaenggli commented 1 year ago

Error 401 means unauthorized. Could you check your AZURE_APP_ID and AZURE_APP_SECRET? In the last issue the AZURE_APP_SECRET was wrong (a common mistake would be to copy SecretId instead of the value).

ahaenggli commented 1 year ago

With the next version, validations will be done at server startup and more logs will be written to make it easier to find incorrect settings :)