Merge pull request #716 from atmire/Authorization-for-downloads-of-restricted-bitstreams

Authorization for downloads of restricted bitstreams
This commit is contained in:
Tim Donohue
2020-07-01 15:43:20 -05:00
committed by GitHub
17 changed files with 321 additions and 27 deletions

View File

@@ -534,4 +534,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))
);
}
}