Configure Permissions for your application - in the Settings menu, choose the 'Required permissions' section, click on Add, then Select an API, and select 'Microsoft Graph' (this is the Graph API). Then, click on Select Permissions and select 'Access the directory as the signed-in user' and 'Sign in and read user profile'.
Actually, the code sample is using the Azure Graph instead of Microsoft Graph. It should select Windows Azure Active Directory instead of Microsoft Graph.
index 10 of step 3 like below:
Configure Permissions for your application - in the Settings menu, choose the 'Required permissions' section, click on Add, then Select an API, and select 'Microsoft Graph' (this is the Graph API). Then, click on Select Permissions and select 'Access the directory as the signed-in user' and 'Sign in and read user profile'.
Actually, the code sample is using the Azure Graph instead of Microsoft Graph. It should select Windows Azure Active Directory instead of Microsoft Graph.