Download user photos from Microsoft Graph API
Mix.install([
{:ms_graph_api_org_user_pics,
github: "chgeuer/ms_graph_api_org_user_pics"}
])
Preparation
Grab an access_token
Navigate to Microsoft Graph Explorer and copy the access_token
into the clipboard.
Click “Evaluate” on the cell below, and paste the access token into the text field.
Also enter the org manager’s e-mail into the other text box.
> NEVER share your access token with any external party!!!
import MsGraphApiOrgUserPics
manager_email_input = Kino.Input.text("Manager e-Mail", default: "johndoe@microsoft.com")
access_token_input = Kino.Input.text("Access token for Graph API", default: "eyJ0eX...")
Kino.Layout.grid([manager_email_input, access_token_input], columns: {1, 1})
After having entered the fields, click “Evaluate” on the cell below
# {response, 0} = System.cmd("cmd.exe", ["/c az account get-access-token --resource-type ms-graph"])
# access_token = :json.decode(response)["accessToken"]
access_token = Kino.Input.read(access_token_input)
all_in_one(Kino.Input.read(manager_email_input), access_token)