I have exposed a REST API with Basic Authentication. I have hardcoded username and password in "UserLogin" server action.

Now I am trying to consume the above API configuring the BaseURL, Basic authentication - username and password. When I try to test the data, below is the error I am receiving. Please help me on this.

HTTP/1.1 500 InternalServerErrorContent-Type: application/json; charset=utf-8(Show all headers){  "Errors": [    "Invalid username or password."  ],  "StatusCode": 500}

Try debugging in the module where you are exposing the webservice, this might help you grasp the location of the error.

How does your OnAuthentication method look like?

Hi, maybe you can remove the action "User_Login" that is inside the OnAuthentication, just to see what's happening.


Removing the User_Login action allows the request but it bypasses authentication which defeats the purpose.

What am I missing?

Many thanks in advance.