I have a single user login system. In the entire org and in all application credential is same. When I am sending login request from angular getting below response :
"Status Code{\"statusCode\":200,\"body\":\"\",\"headers\":{\"date\":\"Thu, 13 Sep 2018 16:04:46 GMT\",\"x-powered-by\":\"Servlet/3.0\",\"content-length\":\"0\",\"set-cookie\":[\"LtpaToken2=UXVOlmR+cut/Qu/cxxxmWaEOEkCtxxxq22GgCI4Iz8nffc1n8O1l5AE0sUCPQfZ+nB9vXS/WMkzxanOexJHzJZb4IgqoxTc0UztF+1amzVysdvdBSSIoblF8fFc9iRMkjYPbxZISg29sU1Q6Au0+Dh50ARY1NhkRQ8iwVst1X6Pbc3Dn4YpLO08utqAi9+35Pun+IFJnbTF6BRvleLKXDifZzwmuZlRKs5gseb9GELQYjTLlXFykm8aq0Ulh0Z8VT/xi0uRFFiR0eUrEvo58sev/3XPYv10//ZTkWOqFnADdzhsBoW4wtWVjlFcvlB/24TBaKtNWmYJd3/tsnoRCWPn1yd4udC0YDFsr3h5SGAjgCRMg7gH8+hvpnIiKzzfcxNmQTPlRjav+SUkBfIxAQ5gmGOmDXDcuzMSbx8zJk1RGNcM/Ksmrcv+SOoDMtmCDHWWqTVn9VLPAnF9bZE7Fkmis7QcNxK5UAoMTCCzgfwMEwHeWm4fY7DblWi8RM=; Path=/\",\"JSESSIONID=0000LsRRstmAD-Y923str-8:-1; Path=/\"],\"expires\":\"Thu, 01 Dec 1994 16:00:00 GMT\",\"cache-control\":\"no-cache=\\"set-cookie, set-cookie2\\"\",\"content-language\":\"en-US\",\"connection\":\"close\"},\"request\":{\"uri\":{\"protocol\":\"http:\",\"slashes\":true,\"auth\":null,\"host\":\"abcd.com\",\"port\":80,\"hostname\":\"abcd.com\",\"hash\":null,\"search\":null,\"query\":null,\"pathname\":\"/hello/rest/login\",\"path\":\"/hello/rest/login\",\"href\":\"http://abcd.com\"},\"method\":\"GET\",\"headers\":{\"authorization\":\"Basic r8htMGw5adkhobSMzYXVn\"}}}"
I am getting undefined when I am trying to access statuscode in my login component,
this.apiDataService.getLogin(user).subscribe((data: any) => {
if (data.statusCode==200) {
this.apiDataService.storeUserData(data.headers, data.authorization);
this.router.navigateByUrl('/validate');
} else {
this.loginError = true;
this.errMsg = 'Invalid username/password';
}
please suggest me how to get statuscode and what should I use for session management, like set-cookie i am not able to use. });