I need assistance with retrieving a profile picture using the Microsoft Azure API. The code snippet provided below demonstrates my attempt to do so.
private getProfilePicture(bearerToken: string, tenantId: string): void {
let command = CommandHelper.createRestBlobCommand([
{ name: 'https://graph.microsoft.com/beta'},
{ name: 'me/photo/$value' }
]);
command.Headers.push({ name: 'Authorization', value: 'bearer ' + bearerToken });
// Retrieve the photo from the graph API.
this._gateway.send(command).subscribe(result => {
let info = result.payload;
var Base64 = require('js-base64').Base64;
var temp = 'data:image/bmp;base64,' + Base64.encode('info');
console.log(temp);
let action = actions.AuthenticationActions.photoLoaded(info);
this._store.dispatch(action);
});
}
However, I am facing an issue where the output I receive is:
data:image/bmp;base64,W29iamVjdCBCbG9iXQ==
Which appears as [object Blob].
My inquiry pertains to how I can obtain the image object in this scenario?