138
Views
4
Comments
Issue in Basic Authentication to REST API

Hi,

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}

Champion
Rank: #104

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?

Champion
Rank: #197

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

Rank: #33056

Paulo,

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

What am I missing?

Many thanks in advance.

Scott

Rank: #7523

Hi Sai,

I had a similar kind of issue.

I resolved it by just setting the 'User Provider' property to 'Users' of the module to true.

I hope that helps.

Thanks,

Shreyas

1.png