Skip to main content

Notifications

Supply chain | Supply Chain Management, Commerce
Unanswered

DeviceAuthenticationProvider.acquireToken did not find a device token in the application stroage.

Posted on by 1,433
My one cloud-hosted Dev box has a problem with POS signing in. It used to work.
I have upgraded the environment and the commerce scale unit on it to the latest V10.0.37. I have exported the data from one of the tier-2 environments and have imported it into this environment.
 
Doesn't matter what I do, it just doesn't want to authenticate the device.
I verified that all the client IDs are correct between HQ and Azure portal. the certificate is good too.
 
It started the activation process but failed on step 1 of 14 when I try to log into CPOS.
 
 
 
The Retail Server Request with request id 'abc' and request url '/RetailServer/Commerce/ActivateDevice' started. Begin Device Activation. Device Number=ADM02; Device Id=xxx; Terminal ID=1010; Force Activate=true; Mass Activate=xxx; Correlation Id={5}Starting: acquireToken for resource 'api://123'. RequestId: abc  Finished: acquireToken. RequestId: 123DeviceAuthenticationProvider.acquireToken did not find a device token in the application stroage.                       Failed to load resource: the server responded with a status of 400 ()RetailServer/Commerce/ActivateDevice?api-version=7.3:1       Failed to load resource: the server responded with a status of 500 ()Server response status code is '500'.The Retail Server Request with request id 'xxx' and request url 'https://computername:port/RetailServer/Commerce/ActivateDevice?api-version=7.3' failed.  Error: A database error has occurred., Status code 500.Device Activation failed. Errors=[{/errorCode/:/Microsoft_Dynamics_Commerce_Runtime_CriticalStorageError/,/message/:/A database error has occurred./}]; Device Number=ADM02; Device Id=abx; Terminal ID=1010; Force Activate=true; Correlation Id=111  The device activation operation failed. usedPreActivatedToken: false
 
Any idea where I can find message: DeviceAuthenticationProvider.acquireToken did not find a device token in the application stroage. 
Or if anybody know how to fix this and let me know, I will very much appreciate it.
I have absolutely no idea what it's looking for. 
 
 
  • Retha Profile Picture
    Retha 1,433 on at
    DeviceAuthenticationProvider.acquireToken did not find a device token in the application stroage.
    Hi Gopi
     
    the health check on the CSU retailserver URL returns successful.
    I have done a full push to the channel DB multiple times.
    The SQL server version will be whatever Microsoft installed when the cloud-hosted environment was deployed. I see this box has SQL server 13.0.5893.48.
    I did log into SSMS and then looked at the [ax].retailDevice table and my device is listed and it has a token.
    So what is this application storage it mentioned in the developer tools where it cannot find a device token?
     
    I see somebody else also logged a question on February 26th for the same issue. So it is not just me that has this issue now.
  • S Gopi Krishna Profile Picture
    S Gopi Krishna 355 on at
    DeviceAuthenticationProvider.acquireToken did not find a device token in the application stroage.
    You can try doing a health check to see if it has the DB error. Also can you confirm which SQL server version you are using and did you run the full push of the data from HQ to channel DB?
  • Retha Profile Picture
    Retha 1,433 on at
    DeviceAuthenticationProvider.acquireToken did not find a device token in the application stroage.
    Suhail, Because my Dev box is now set up with a local IIS-hosted CSU, it doesn't write to the event viewer. So I can't use that unfortunately.
     
    Hana, your link seems to be for an actual device. The device it complains about is the login device set up under Retail and commerce > Channel setup> POS setup > Devices.
    This device is activated and it passed validation. so the setup is fine and the setup of the register it is linked to is fine too. It didn't change. And if there was something wrong , the DB refresh that i did should have removed any wrong setup. I compared the setup with what is on my other Dev box that works, and it looks exactly the same. It's not information that usually change.
     
    Judy, I compared the setup under the Identity providers with what is in Azure portal and it is all correct.
     
    Looking at the Developer tools > concole tab, the GetEnvironmentConfigurationCommerceServiceRequest trigger succeeds. So it can read the environment configuration.
    then it starts with the acquire token from the retail server resource id. It uses the URI as set up under commerce shared parameters > Identity providers where the identity provider is the Azure AD, the relying party is the application id of the Cloud POS as set up under app registration in Azure portal and the server resource id is the application id URI of the retail server as set up in Azure portal for the retail server app registration.
    I checked the numbers multiple times and they are correct.
    It finishes the acquire token step.
    It does this twice. Then it starts with the device activation and do the acquire Token and finish acquire token again and then it gives the error:
    DeviceAuthenticationProvider.acquireToken did not find a device token in the application stroage.
    It said a database error occured.
     
    Device Activation failed. Errors=[{"errorCode":"Microsoft_Dynamics_Commerce_Runtime_CriticalStorageError","message":"A database error has occurred."}]
     
     
     
     
     
     
     
  • Suhail Ismail Profile Picture
    Suhail Ismail 103 on at
    DeviceAuthenticationProvider.acquireToken did not find a device token in the application stroage.
    Hi,
     
    It seems there is an internal server error due to some error related to db. If you check event viewer you will be able to get the exact error. Most probably it is missing tables, views, fields and types
  • Hana Xue Profile Picture
    Hana Xue Microsoft Employee on at
    DeviceAuthenticationProvider.acquireToken did not find a device token in the application stroage.
    Hi,
    I have little experience with this, it seems to be related to authentication, could you see if this link is useful? azure active directory - "AADSTS700003: Device object was not found in the tenant" issue started since the beginning of September - Stack Overflow
    Best Regards,
    Hana
  • Judy Profile Picture
    Judy Microsoft Employee on at
    DeviceAuthenticationProvider.acquireToken did not find a device token in the application stroage.
    Have you cheeked the Microsoft Document regarding troubleshoot sign-in issues in the Microsoft Dynamics 365 Commerce Store Commerce app.
    Hope other experts can suggest on this.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans