Skip to Content

Service Layer Login Invalid Session

Hi, we are trying to login in sap service layer using javascript (vue js) , at first i receive a CORS error , then i create a proxy to bypass the CORS, now its working, but when i login is says 401 unauthorized but the response throws Invalid Session with error code 301

{ "error" : { "code" : 301, "message" : { "lang" : "en-us", "value" : "Invalid session." } } }

Here is my api on login:

axios({ url: '/service-layer/Login', withCredentials: true, method: 'post', data: { CompanyDB: "SBODEMOAU", UserName: "manager", Password: "1234" } }).then( (response) => { console.log( }).catch( err => { console.log(err) });

note that i create proxy named service-layer, the original url is

we try to login in postman and its working fine

Add a comment
10|10000 characters needed characters exceeded

Related questions

0 Answers

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.