com.aeontronix.enhancedmule.tools.emclient.authentication.CredentialsProviderAccessTokenImpl Maven / Gradle / Ivy
/*
* Copyright (c) Aeontronix 2021
*/
package com.aeontronix.enhancedmule.tools.emclient.authentication;
import com.aeontronix.enhancedmule.tools.authentication.AccessTokenCredentials;
import com.aeontronix.enhancedmule.tools.authentication.Credentials;
import com.aeontronix.enhancedmule.tools.emclient.EnhancedMuleClient;
import java.io.IOException;
public class CredentialsProviderAccessTokenImpl implements AnypointBearerTokenCredentialsProvider {
private String tokenId;
private String tokenSecret;
public CredentialsProviderAccessTokenImpl(String tokenId, String tokenSecret) {
this.tokenId = tokenId;
this.tokenSecret = tokenSecret;
}
@Override
public Credentials getCredentials() throws IOException {
return new AccessTokenCredentials(tokenId, tokenSecret);
}
@Override
public String getAnypointBearerToken(EnhancedMuleClient restClient) throws IOException {
return restClient.getRestClient().get("/anypoint/bearer").execute(String.class);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy