Ushahidi Platform - API returns 400 on login


#1

Hi everyone,
I am trying to install Ushahidi v3 .
Client seems to connect with API, but I cannot log in with username: admin and password: admin.
API responds with this error: “POST /oauth/token HTTP/1.1” 400 383 “http://79.137.37.202:3000/views/map” when I execute the command “tail -f access_log”
Any help and suggestion would be very appreciated :slight_smile:


#2

What do you get if you try to access /api/v3/config instead of /oauth/token ?


#3

http://79.137.37.202/platform/httpdocs/index.php/api/v3/config


#4

That looks good. Not sure what would have happened with your admin user.

You can create an admin user from the command line of your server:

bin/ushahidi user create --email=(your email) --password=(your password) --role=admin

this command should be executed from the base folder of the API (“platform” in your setup)


#5

Yes, I tried that…created the admin user from command line but the problem is not solved. When I refresh the page it says “Not found
The requested URL was not found on this server.”

Here you can see it yourself: http://2017.zalart.al/views/map
In whatever page you are, if you refresh it, it says it doesnt exist in the server anymore


#6

That seems to be a server misconfiguration. The trick in our application (and many other ones based on Angular JS) is internally redirecting any non existing address to index.html .

If using apache, it should be properly configured to honour .htaccess files (“AllowOverride All”), mod_rewrite should be enabled as well. We provide the .htaccess files that perform the internal redirection mentioned above.