Q:

How to access the value of this json token to store in in local storage

 loginUser(user: any) {
    return this.http.post(this.loginUrl, user)
    .subscribe((success: any) => {
      if(success) {
        localStorage.setItem('access_token', success.token);
        localStorage.setItem('token', JSON.stringify(success.token));
        return true;
      }
    });
  }

What is returned https://i.imgur.com/Km8X2CX.png
Result in storage https://i.imgur.com/FfsOTb5.png
I want to store the value of the token
Changing this to 
localStorage.setItem('access_token', success);
localStorage.setItem('token', JSON.stringify(success));

Result - https://i.imgur.com/c9wMosF.png

A:

you should set success.success.token instead.
Better to rename the response as response
loginUser(user: any) {
    return this.http.post(this.loginUrl, user)
    .subscribe((response: any) => {
      if(response) {
        localStorage.setItem('access_token', response.success.token);
        // localStorage.setItem('token', JSON.stringify(response.success.token)); probably not needed.
        return true;
      }
    });
  }

