Hello,
My server is currently running on UD 2.6 with a certificate.
If i try with the 2.7 (and the last nightly release) the login route does not work…
I use POSTMAN to test my routes.
If send a request to https://myserver/api/login on 2.6 i get the token… but on 2.7 nothing !
i enabled the logging and get the following message: 11:48:09 [Debug] PowerShellExecutionService UDPage = 11:48:09 [Debug] Quartz.Core.JobRunShell Trigger instruction : NoInstruction 11:48:17 [Info] Microsoft.AspNetCore.Server.Kestrel Connection id "0HLROKNBM0LC1" bad request data: "Invalid request lin e: ''"
I havent changed a thing between the 2.6 and 2.7 just tried to update UD version that’s all
On thing: i’m doing my test in a dev environnement, so, in this environnement i did not provide a licence, and have to restart my UD server every hour, maybe something changed betweend 2.6 and 2.7 ???
I might be in over my head here, as i’ve never used rest auth myself.
There is not any references to any major changes to the restauth in the change logs as far as i see.
if i’m not wrong the route to login must be “/api/login” not “/login”, and so the uri example should be $Token = Invoke-RestMethod -Uri http://localhost:10001/api/login -Method POST -Body @{ UserName = "Adam"; Password = "Test" }
This is from the UD test suite. This particular test is passing in the latest 2.8 nightly build. The one difference I’m noticing is that we are sending in JSON rather than form data and it is using the /login endpoint. I’m not sure why that changed but if you file a bug, we can look at making sure it works as it did in 2.6 for 2.8
That’s the correct release. If you change your postman request to use /login and change the body to use JSON rather than form-data does it work for you?
Nop sorry it’s not working, if i try to use /login i get a 500 internal error … ! like this endpoint does not exist … …
i double checked the module i’m using, can you confirm:
version should be 2.7.0
Version GuId : c7894dd1-357e-4474-b8e1-b416afd70c2d
Yes me too, and i m a bit lost
so i tried with the /login:
PS> Invoke-RestMethod -Uri https://myserver/login -Body (@{username="Ayoub";password="toto"} | C
onvertTo-Json) -Method Post
Invoke-RestMethod : The underlying connection was closed: An unexpected error occurred on a send.
At line:1 char:1
+ Invoke-RestMethod -Uri https://myserver/login -Body (@{username="Ay ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebExc
eption
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
i enabled ud logging:
17:02:04 [Info] Microsoft.AspNetCore.Server.Kestrel Connection id "0HLROQ6JGEABK" bad request data: "Invalid request lin
e: ''"
17:02:04 [Info] Microsoft.AspNetCore.Server.Kestrel Connection id "0HLROQ6JGEABL" bad request data: "Invalid request lin
e: ''"
Any Idea ? maybe there are some logs somewhere i’m not aware of ?
I’m really stuck here … cant migrate to 2.7
My certificate is a web certificate, i also tried with a basic sefl signed certificate but the same error keeps popping in the log ( same as my previous thread )… maybe i missed something … !
ok i’ll build a single test route, with the same auth method as your pester test and try it on http/https
For https i’ll use the certificate i use for my rest server on 2.6