class AzureCredentialConnector implements CredentialConnector {

    @Override
    public Map<String, String> initCodeGrantFlow(CloudContext cloudContext, CloudCredential cloudCredential) {
        Map<String, String> parameters = new HashMap<>();
        AzureCredentialView azureCredential = new AzureCredentialView(cloudCredential);

        ApplicationTokenCredentials applicationCredentials = new ApplicationTokenCredentials(
                azureCredential.getAccessKey(),
                azureCredential.getTenantId(),
                azureCredential.getSecretKey(),
                AzureEnvironment.AZURE);

        String replyUrl = appCreationCommand.getRedirectURL(String.valueOf(cloudContext.getAccountId()), azureCredential.getDeploymentAddress());
        CbDelegatedTokenCredentials creds = new CbDelegatedTokenCredentials(applicationCredentials, replyUrl, authenticationContextProvider,
                cbRefreshTokenClientProvider);

        String state = UUID.randomUUID().toString();
        parameters.put("appLoginUrl", creds.generateAuthenticationUrl(state));
        parameters.put("appReplyUrl", replyUrl);
        parameters.put("codeGrantFlowState", state);
        return parameters;
    }

}