AuthenticationResult created with NativeBrokerPlugin has invalid expiresOn value #7086
Labels
bug-unconfirmed
A reported bug that needs to be investigated and confirmed
msal-node
Related to msal-node package
msal-node-extensions
Related to msal-node-extensions package
Needs: Attention 👋
Awaiting response from the MSAL.js team
public-client
Issues regarding PublicClientApplications
question
Customer is asking for a clarification, use case or information.
Core Library
MSAL Node (@azure/msal-node)
Core Library Version
2.7.0
Wrapper Library
MSAL Node Extensions (@azure/msal-node-extensions)
Wrapper Library Version
1.0.15
Public or Confidential Client?
Public
Description
Please note, this only occurs with the NativeBrokerPlugin.
The AuthenticationResult returned by the NativeBrokerPlugin has an invalid expiresOn value.
The code is creating a Date object from a timestamp based in seconds but Date objects are based on the milliseconds since January 1, 1970.
This causes evaluation of the expiresOn in relation to Date.now() to always appear as though the result has expired.
Simply multiplying the expiresOn by 1000 resolves the issue.
Error Message
None
MSAL Logs
None
Network Trace (Preferrably Fiddler)
MSAL Configuration
Relevant Code Snippets
Reproduction Steps
Create a NativeBrokerPlugin
Get an AuthenticationResult
Check the AuthenticationResult.expiresOn property
Expected Behavior
Result should be a proper date object in the future not the past.
Identity Provider
Entra ID (formerly Azure AD) / MSA
Browsers Affected (Select all that apply)
Other
Regression
No response
Source
External (Customer)
The text was updated successfully, but these errors were encountered: