Issues with ASP.NET security provider

investigating
#1

I have been using classic asp for my server side language and haven’t had any issues, I’ve been able to get it to work without issue. However I wanted to try ASP.NET. I created a new project, created a login page and followed the documentation for using site security with a database (MSSQL) just like I have with Classic asp. Whenever I click submit, nothing happens on the page but in the network tools i see I am getting a generic 500 error. This is the exact error message under the response tab:

Option ‘username’ in action ‘login’ of module ‘auth’ is required

I double checked my post variable names, they all match. I checked the request paylod tab and the variables look correct there, and they have the correct data. I then tried to just do a simple query of the table and that seems to work ok, so my credentials are ok and I know the server is setup correctly.

Any ideas what may be happening? Is anybody else using ASP.NET?

Thanks,
Chris

#2

Still having issues. I’ve tried this on two different servers. I can do everything with the .NET server model except perform the login. Connecting to the database, query, returning results on the page, etc all works fine. Here is the error message I’m getting when I click the submit button to perform the login action:

Here is my code, straight from the docs and something I’ve done successfully with classic asp many times.

LoginError3

Including @George and @Teodor to see if this is maybe a server config issue or a bug in the ASP.NET server model. Any help would be greatly appreciated. Trying to move away from classic asp.

Thanks,
Chris

#3

Hi Chris,

Could you enable debugging so you can see the real error?

Follow the procedure:

#4

Yes, I enabled debugging. It is in the first screenshot, but here it is in more detail. It says error 500 which is server side, and it’s in the login module. Everything else works fine, like returning queries, it’s just for the login action. Is there anything special that needs to be changed on the server for ASP.NET?

More detail:


#5

So continuing with this, I deleted all the files in the project and reconfigured the project with classic asp server model. I used the same login page, just updated the form action and everything works. This leads me to believe it is either in the code for the security provider login action for ASP.NET or a server config issue. We have 17 windows web servers hosting almost half a million .net webform and MVC pages and they all work fine, but it may be a config issue specifically for this.
Was the detailed error message enough to determine what it may be? I hate to keep asking but I really would like to get away from classic asp.

@George, @Teodor any assistance would be much appreciated.

Thanks,
Chris

#6

I think that I found the issue, it is not using the defaults correctly and thinks that the options for username/password are not set. I will be working on a fix, probably will have it somewhere next week.

In the meantime you can get around it by putting the default values directly in the JSON. Go to the action in Server Connect and use the Open in Editor, it will open the JSON file in the editor. There edit the options for the login action. It should become something like:

{
  "name": "identity",
  "module": "auth",
  "action": "login",
  "options": {
    "provider": "security1",
    "username": "{{ $_POST.username }}",
    "password": "{{ $_POST.password }}"
  }
}
#7

Thank you very much Patrick. I will try that and let you know.

Greatly appreciated. Have a good weekend.

#8

I can confirm that it does indeed work with the changes you suggested. Awesome.

#9

Patrick:
I am having similar problems in performing straight forward updates. The identity is not being captured and therefore the update fails. I found this occurred when using the V2.0 beta 3 update. The update action worked with no problem prior to this. I am in the process of reinstalling v 1.9.9, but I will check the JASON file to see if there is a similar problem. ASP.NET seems to have the problems, as it also had update and insert problems in early versions.

#10

I have not tried to do any updates or inserts yet. Are you using guids as your pk?

#11

No I am using a simple Identity derived form the SQL database.

#12

Here is the updated Server Connect DLL that should fix the issue with the required username. We will also bundle it with the next Wappler update.

DMXzone.ServerConnect.zip (55.5 KB)

#13

Great, thank you.

#14

Login works great. The logout does not work though. Here is the error:

message": “Exception has been thrown by the target of an invocation.”,

#15

I will investigate this

assigned patrick #16
unlisted #17
#18

@turn3636 which steps do you have in the logout action? Does it also show the orgException in the response?

#19

I have these steps in the action steps:


then in the app structure I have the action, click no auto load:


and I have it connected to a dropdown item:

and it code:

#20

I believe the error was generated in the first step, which is strange since the login works for you. Can you give the orgException from the json response.