Auth0 Home Blog Docs

How do I authenticate users using an API Web Service and Auth0's hosted login page?



Use Case : By passing Legacy app’s Login page.

Objective : Bypass an existing legacy app login ( Energycap - using Auth0’s hosted login page to authenticate users. To do so, I am using their REST- Login API ( . This API requires a body with the following parameters:

*// JSON to pass to /login via POST method

“DataSource”: “EnergyCAP_DB”,
“Password”: “password”,
“Username”: “test”

// If successful, the resulting JSON should look similar to:

“Status”: “”,
“Data”: {
“Token”: “4E-70-F0-BE-08-10-00-66-60-65-5E-A1-11-0F-E0-CC-5F”,
“User”: {
“UserName”: “test”,
“FullName”: “Test User”
“meta”: {
“Rel”: “”

The received token can then be used to bypass EnergyCap login screen or with other API calls.
I have not been successful adding an additional field (DataSource field as a requirement for the login API) to my hosted Auth0 login page. Despite that, at this point I was hoping to get an error from the login api indicating that I was missing the DataSource field

“status”: {
“The DataSource field is required.”
“help”: “”

Instead, am getting the following vague error

{“status”:{“message”:“Processing of the HTTP request resulted in an exception. Please see the HTTP response returned by the ‘Response’ property of this exception for details.”,“help”:""}}
Additionally my form data only shows the “code”, and “state” values. There is no “username” or “password” despite adding them as “user_metadata” ![loginAPIResponse][1]

I appreciate your guidance and assistance figuring this out.