Skip to Content
0
Nov 05, 2019 at 07:03 AM

Service Layer Login Invalid Session

264 Views Last edit Nov 05, 2019 at 07:11 AM 3 rev

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(response.data) }).catch( err => { console.log(err) });

note that i create proxy named service-layer, the original url is http://198.100.153.14:50011/b1s/v1

we try to login in postman and its working fine