71504: short-lived token for downloading files through FileService

This commit is contained in:
Kristof De Langhe
2020-06-19 17:26:11 +02:00
parent 5cef15eb20
commit bbaaaed4b5
7 changed files with 97 additions and 17 deletions

View File

@@ -546,4 +546,14 @@ export class AuthService {
return this.getImpersonateID() === epersonId;
}
/**
* Get a short-lived token for appending to download urls of restricted files
* Returns null if the user isn't authenticated
*/
getShortlivedToken(): Observable<string> {
return this.isAuthenticated().pipe(
switchMap((authenticated) => authenticated ? this.authRequestService.getShortlivedToken() : observableOf(null))
);
}
}