Getting an http 301 error on attempting to get rest oauth

Hi.

I have a simple application, which i want to access through rest. I am using cuba studio and have a licence.

The app is basic, i’ve just created the project (7.10.beta3) and added an entity.
When i try to follow the documentation to get a token i get a 301. If i tell curl to follow 301, i get the index html page.
my curl is
curl -X POST -L -H “Content-type: application/x-www-form-urlencoded” -H “Authorization: Basic Y2xpZW50OnNlY3JldA==” -d “grant_type=password&username=admin&password=admin” http://localhost:8080/app/rest/v2/oauth/token

Wether i POST or GET gives me a 301.
I am sure i miss something basic. I’ve been blocked for so long i can not see anymore so i need fresh eyes to get into this.
Thank you for any input.

Hi,

HTTP 301 means that there is no REST API at all in your system (it is Vaadin redirecting you to /app).

As you can notice from release notes CUBA Platform Release Notes
REST API has been moved to a separate add-on in 7.1.

The easiest solution for you is to switch platform version to 7.0.10 where REST API functionality is built in.

2 Likes