Azure-Samples / azure-iot-central-samples-csharp

An sample project that interacts with Azure IoT Central rest APIs.
MIT License
7 stars 8 forks source link

Sample doesn't work anymore - "The refresh token has expired due to inactivity" #4

Closed wickste closed 2 years ago

wickste commented 3 years ago

I get this error right away when running "dotnet run" in the src folder:

Starting Azure IoT Central Application... Unhandled exception. System.Exception: {"error":"invalid_grant","error_description":"AADSTS700082: The refresh token has expired due to inactivity. The token was issued on 2021-06-12T02:13:39.9261360Z and was inactive for 90.00:00:00.\r\nTrace ID: 9608b20c-0533-46e8-9dcb-fb56783f2301\r\nCorrelation ID: 1af57d3f-e7aa-4b3d-9ce5-7d58ea45f0e9\r\nTimestamp: 2021-09-21 22:36:20Z","error_codes":[700082],"timestamp":"2021-09-21 22:36:20Z","trace_id":"9608b20c-0533-46e8-9dcb-fb56783f2301","correlation_id":"1af57d3f-e7aa-4b3d-9ce5-7d58ea45f0e9","error_uri":"https://login.microsoftonline.com/error?code=700082"} at IoTCentralApp.IoTCentralClient.getRefreshedAccessToken(AccessToken[] accessTokensArray, String resouce) in C:\temp\central\azure-iot-central-samples-csharp\IoTCentralApp\src\IoTCentralClient.cs:line 190 at IoTCentralApp.IoTCentralClient.ParseTokenFromAzureCli() in C:\temp\central\azure-iot-central-samples-csharp\IoTCentralApp\src\IoTCentralClient.cs:line 43 at IoTCentralApp.IoTCentralConsole.RunAsync() in C:\temp\central\azure-iot-central-samples-csharp\IoTCentralApp\src\IoTCentralConsole.cs:line 46 at IoTCentralApp.Program.Main(String[] args) in C:\temp\central\azure-iot-central-samples-csharp\IoTCentralApp\src\Program.cs:line 12 at IoTCentralApp.Program.<Main>(String[] args)

yang-hai-feng commented 2 years ago

@wickste we updated the examples with latest GA Central API, let us know if that works.