Exchanging data between EPC_1522 and linux using REST on same enge

I am working on application that runs ML model in Linux environment inside the EPC 1522. The application exchange data between using the REST API. Everything work well until I have to do a factory reset. When I build Everything back the REST API stop working. The error is that about having a wrong password. I did check several posts here one relate to setting the HMI Webserver with PLCNext User management. I also enable the Rest interface. See below the error.
Access Token Response: b’{„code“:„1e6c64e97067e655“,„expires_in“:600}’
Username: XXXX
Password: YYYYY
Auth Token Response: b’{„apiVersion“:„1.10.0.0“,„projectCRC“:87044125,„error“:{„code“:401,„details“:[{„domain“:„authorization“,„reason“:„wrongPassword“}]}}’
Exception during authentication: Access token not found in the authToken response.
Exception occurred: Access token not found in the authToken response.

Going back to basics - are you able to get an authentication token using curl on the command-line, using the first step of the procedure in the Info Center?
Introduction Introduction to the REST data interface
If not - can you give us the HTTP POST request that you’re sending to request the authentication token?