Search in sources :

Example 6 with IClientCredential

use of com.microsoft.aad.msal4j.IClientCredential in project OpenUnison by TremoloSecurity.

the class AttributeChange method loadCredentials.

private void loadCredentials() throws ProvisioningException {
    IClientCredential c;
    try {
        app = ConfidentialClientApplication.builder(clientId, ClientCredentialFactory.createFromSecret(this.clientSecret)).authority(this.authority).build();
    } catch (MalformedURLException e) {
        throw new ProvisioningException("Could not obtain confidential client application", e);
    }
    ClientCredentialParameters parameters = ClientCredentialParameters.builder(this.clientScopes).build();
    azureAuthToken = app.acquireToken(parameters).join();
    this.oauth2Token = azureAuthToken.accessToken();
}
Also used : MalformedURLException(java.net.MalformedURLException) ProvisioningException(com.tremolosecurity.provisioning.core.ProvisioningException) IClientCredential(com.microsoft.aad.msal4j.IClientCredential) ClientCredentialParameters(com.microsoft.aad.msal4j.ClientCredentialParameters)

Aggregations

IClientCredential (com.microsoft.aad.msal4j.IClientCredential)6 ConfidentialClientApplication (com.microsoft.aad.msal4j.ConfidentialClientApplication)5 MalformedURLException (java.net.MalformedURLException)5 ClientCredentialParameters (com.microsoft.aad.msal4j.ClientCredentialParameters)2 IAuthenticationResult (com.microsoft.aad.msal4j.IAuthenticationResult)2 MessageFormat (java.text.MessageFormat)2 HashSet (java.util.HashSet)2 ExecutionException (java.util.concurrent.ExecutionException)2 ExecutorService (java.util.concurrent.ExecutorService)2 ProvisioningException (com.tremolosecurity.provisioning.core.ProvisioningException)1