Update authenticate function to fit Azure AD requirement.

I am using your module to authenticate to Azure AD and get access to Graph API, however OAuth2 of Azure AD is a little bit different from standard one, so i make some changes.