Base solution for your next web application
Open Closed

POSTMAN AUTHENTICATION FAILING #9222


User avatar
0
alfar_re created

Hello,

I'm getting the following error on postman. What could be the issue?

I'm passing this for authentication:

{ "userNameOrEmailAddress":"admin", "password":"123qwe" }

Then this is the result:

{ "result": null, "targetUrl": null, "success": false, "error": { "code": 0, "message": "Current user did not login to the application!", "details": null, "validationErrors": null }, "unAuthorizedRequest": true, "__abp": true }


4 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team

    hi

    Can you share the request code generated by postman?

  • User Avatar
    0
    alfar_re created

    Here you go

  • User Avatar
    0
    robert created
    Support Team

    Hi alfar_re,

    1. You need to call the authenticate API with this to get the access token :

    https://localhost:44301/api/TokenAuth/Authenticate

    1. Use the access token acquired above to call other API by passing the token in the header

    Please refer to these steps :

    https://docs.aspnetzero.com/en/aspnet-core-angular/latest/Features-Angular-Token-Based-Authentication

    You need to pass Abp.TenantId and Content-type in the header as explained in the above link.

  • User Avatar
    0
    alfar_re created

    Hi @robert,

    This worked really well. Thank you.