I am using the MicrosoftLoginConnector component to authenticate users of my application in Azure AD, but I also need to fetch this user's photo. When I try to do this search I get the error "401 Unauthorized".

Can someone help me?

I am working on version 10.


Att,


Guilherme

Solution

Hi Guilherme,

One option to resolve this is by manipulating the request to pass the authorization token.
Use the URL: https://graph.microsoft.com/v1.0/me/photo/$value, and in response Format put it as Binary. In the REST service node add the OnBeforeRequest method.



In the OnBeforeRequest method add the action of the MicrosoftLoginConnector GetUserToken package, enter the email address of the user in question and the Resource is usually "https://graph.microsoft.com". Add an HTTPHeader variable to enter Authorization and the value “GetUserToken.Token”, after that add the HTTPHeader variable to the CustomizedRequest.Headers request header.


Solution

Thanks Hugo!