title: Returning an Observable<boolean> from canActivate method and redirect on false
body: <p>I have been searching for a solution with no luck. I need to call the server if a user is authorized and i need canActivate method to wait for the result for that call. But i can`t seem to put pieces together. Below is my code, my question is in the comments of the code. </p>
  
  <pre><code>  canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable&lt;boolean&gt; {
  
      let user: EUser = new EUser();
      user.sessionId = localStorage.getItem("sessionId");
  
      //I am not sure how to implement this part. 
      // I need to recieve the response and get user.isAuthorized value and return it
      // as an observable. 
      this.authenticationService.isAuthorized(user).subscribe((user)=&gt;{
          //Here i need to get user.isAuthorized and 
          //if the value is false, i need to navigate to login with this.router.navigate['login'] and return it. 
          //if the values it true, i need the code continue as it is. 
      });
  
    }
  </code></pre>
  
  <p>AuthenticationService</p>
  
  <pre><code>isAuthorized(user:EUser){
      return this.http.post(ConnectionHelper.SERVER_URL+
            ConnectionHelper.USER+ConnectionHelper.ISAUTHORIZED,user).map(res =&gt; res.json());
  }
  </code></pre>