import { ErasConfigService } from './../eras-config.service'; import { ErasHttpService } from './../eras-http.service'; import { User } from '../../model/user'; import { Observable } from 'rxjs/Observable'; import 'rxjs/add/operator/do'; export declare class AuthDataService { private erasHttpService; private erasConfigService; constructor(erasHttpService: ErasHttpService, erasConfigService: ErasConfigService); /** * Generate an access token for login and password. ___see also___: [AuthService]{@link AuthService} * * ___returns a observable of:___ * * ``` * { * accessToken: string, * tokenType: string * user: User * } * ``` * * ___see also___: [User]{@link User} * * @param login Default true. If true, generate an access token and signin the user authenticated in AuthService. * If false, it only generate an access token, but does not save the logged in user. * @param password * @param loggin */ authenticate(login: string, password: string): Observable; /** * Generate a new access token based on an old. Need to be authenticaded. * * ___returns a observable of:___ * * ``` * { * token: string, * user: User * } * ``` * * ___see also___: [User]{@link User} * * @param token Valid access token * @param expiration Expiration time in milliseconds. If empty, the expiration time will be the same as the original token */ renew(token: string, expiration?: number): Observable<{ token: string; user: User; }>; }