Base solution for your next web application
Open Closed

Invalid Password #334


User avatar
0
ecairncross created

Hi There,

I've created a Project based on ABP + ModuleZero template, but when I try to login as admin with the default password(AM4OLBpptxBYmM79lGOX9egzZk3vIQU3d/gFCJzaBjAPXzYIK3tQ2N7X4fcrHtElTw==), I get an invalid password exception. I've tried creating the project twice, and the password in the db is definitely correct, but I can't seem to get around this error.

Also, this means that because I can't log a user in, abpauthorize always fails. Is there a way to disable the abpauthorize login check, or override the abpauthorize function to implement custom authorization attributes?

Thanks a lot!


5 Answer(s)
  • User Avatar
    0
    twigman08 created

    The password that is seeded in the database by default is already hashed. The default password for admin is 123qwe. So try giving that as the password.

  • User Avatar
    0
    ecairncross created

    Yep, that did the trick!

    Any idea of how to implement custom authorization using the ABPAuthorize attribute? I don't see any examples for overriding the attribute...

    Thanks again.

  • User Avatar
    0
    hikalkan created
    Support Team

    Easy.. just go to PermissionChecker in your project (if you created from template, you should have it) and override IsGrantedAsync(long userId, string permissionName) and IsGrantedAsync(string permissionName) methods.

  • User Avatar
    0
    ecairncross created

    Hey,

    I've tried overriding those methods, returning an arbitary value just so i can see if the debugger goes into the methods, but it never ends up there. It goes into the PermissionChecker constructor, but never finds itself in the overridden methods, and therefore never never applies custom logic. Any ideas?

  • User Avatar
    0
    hikalkan created
    Support Team

    I just tested, it just enters my overrided method. ABP calls these methods when an AbpAuthorize attribute is used with a permission name, or checked a permission manually.