public static TokenProvider createAzureActiveDirectoryTokenProvider ( String authorityUrl , String clientId , String clientSecret ) throws MalformedURLException { AuthenticationContext authContext = createAuthenticationContext ( authorityUrl ) ; return new AzureActiveDirectoryTokenProvider ( authContext , new ClientCredential ( clientId , clientSecret ) ) ; }
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 .