code: public static TokenProvider createAzureActiveDirectoryTokenProvider(String authorityUrl, String clientId, String clientSecret) throws MalformedURLException
      {
          AuthenticationContext authContext = createAuthenticationContext(authorityUrl);
          return new AzureActiveDirectoryTokenProvider(authContext, new ClientCredential(clientId, clientSecret));
      }
docs: Creates an Azure Active Directory token provider that acquires a token from the given active directory instance using the given clientId and client secret.
  This is a utility method.
  @param authorityUrl URL of the Azure Active Directory instance
  @param clientId client id of the application
  @param clientSecret client secret of the application
  @return an instance of Azure Active Directory token provider
  @throws MalformedURLException if the authority URL is not well formed