Developer forum

Forum » Dynamicweb 10 » Dynamicweb CLI user

Dynamicweb CLI user

Søren Jakobsen
Reply

Hi,

i'm working on a local DW10 installation and wants to use the DW CLI but i'm not able to login with the dw login command. I can set the environment with dw env.

Where do I create the user? Is it a DW backend user?

https://doc.dynamicweb.dev/documentation/fundamentals/code/CLI.html#editing-the-dwc-configuration


Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Hi Søren

Yes, it is a Dynamicweb backend user with administrator priviliges. I will have a clarification that it is a Dynamicweb user that is needed added to the docs.

BR Nicolai

 
Aki Ruuskanen
Aki Ruuskanen
Reply

Hi,

I have a problem with loging in with the CLI that I cannot figure out. 

I have a backend user "aki" / "test123". It has backend privilegies och is an administrator. 

I have a DW10 running on https://localhost:40025/. I can login to backend through "/admin".

CLI:

PS C:\users\aki.ruuskanen\source\repos\dw10swift2> dw
Environment: development
User: undefined
Protocol: https
Host: localhost:40025

PS C:\users\aki.ruuskanen\source\repos\dw10swift2> dw login
? environment: development
? username: aki
? password: [hidden]

The CLI says:

Could not get the necessary information from the login request, please verify its a valid user in your Dynamicweb solution.

And the log says:

info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/1.1 POST https://localhost:40025/Admin/Authentication/Login - application/x-www-form-urlencoded 29
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[0]
      Executing endpoint 'Dynamicweb.Management.UI.Controllers.AuthenticationController.Login (Dynamicweb.Management.UI)'
info: Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker[102]
      Route matched with {action = "Login", controller = "Authentication", area = ""}. Executing controller action with signature Microsoft.AspNetCore.Mvc.IActionResult Login(Dynamicweb.CoreUI.Rendering.Models.LoginModel) on controller Dynamicweb.Management.UI.Controllers.AuthenticationController (Dynamicweb.Management.UI).
info: Microsoft.AspNetCore.Mvc.RedirectToActionResult[1]
      Executing RedirectResult, redirecting to /Admin/Authentication/Login/Password.
info: Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker[105]
      Executed action Dynamicweb.Management.UI.Controllers.AuthenticationController.Login (Dynamicweb.Management.UI) in 29.9165ms
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[1]
      Executed endpoint 'Dynamicweb.Management.UI.Controllers.AuthenticationController.Login (Dynamicweb.Management.UI)'
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished HTTP/1.1 POST https://localhost:40025/Admin/Authentication/Login - 302 0 - 192.2286ms

 

Any ideas what might be the problem here?

Regards / Aki 

 

 
Jeppe Eriksson Agger Dynamicweb Employee
Jeppe Eriksson Agger
Reply

Hi Aki,

This is a known issue that appeared as a result of the the changes to the login process when TOTP and other factors were introduced.

We are aware of the issue are a looking into ways to solve it. Until there is a solution, you can use an API key with your commands. More information available here: https://doc.dynamicweb.dev/documentation/fundamentals/code/CLI.html#environments-and-users

- Jeppe

 
Aki Ruuskanen
Aki Ruuskanen
Reply

OK, thanks Jeppe. 

/Aki

 

You must be logged in to post in the forum