/*
 * Copyright (C) 2018 Robert Bosch GmbH Copyright (C) 2018 Robert Bosch Manufacturing Solutions GmbH, Germany. All rights reserved.
 */

import { Observable } from 'rxjs';

export abstract class AuthenticationService {
  public redirectUrl: string;

  /**
   * Returns accessToken as string or null.
   */
  abstract getAccessToken(): Observable<string>;

  /**
   * Return object representing payload of id token or null.
   */
  abstract getIdTokenPayload(): any;

  /**
   * Returns expiration time of accessToken or 0.
   */
  abstract getExpiration(): Observable<number>;

  /**
   * Returns name of logged in user or null.
   */
  abstract getUsername(): string;

  /**
   * Returns realm of logged in user or null.
   */
  abstract getTenantId(): string;

  abstract getRoles(): Observable<string[]>;

  abstract logout(): Observable<boolean>;

  abstract isAuthenticated(): Observable<boolean>;
}
