<<<<<<< .mine

package com.iamberry.app.international.util.kafka;

import com.iamberry.wechat.tools.MD5Util;

import java.util.HashMap;
import java.util.Map;

import javax.security.auth.login.AppConfigurationEntry;
import javax.security.auth.login.Configuration;

public class SaslConfiguration extends Configuration {

	public AppConfigurationEntry[] getAppConfigurationEntry(String name) {
		Map<String, String> options = new HashMap<String, String>();
		options.put("username", "5kkyurvvtt58bbuxueee");//APPKEY
		// key
		String temp1 = MD5Util.MD5Encode("rhj6na6u3y6uhy6qrbb3944mg5uqqpbb", "UTF-8");
		String temp = MD5Util.MD5Encode("5kkyurvvtt58bbuxueee" + temp1, "UTF-8");
		options.put("password", temp.substring(8, 24));//MD5(APPKEY+MD5(云端APPSECRET))后，取中间16位
		AppConfigurationEntry entry = new AppConfigurationEntry(
				"org.apache.kafka.common.security.plain.PlainLoginModule",
				AppConfigurationEntry.LoginModuleControlFlag.REQUIRED, options);
		AppConfigurationEntry[] configurationEntries = new AppConfigurationEntry[1];
		configurationEntries[0] = entry;
		return configurationEntries;
	}
}
||||||| .r0
=======

package com.iamberry.app.international.util.kafka;

import java.util.HashMap;
import java.util.Map;

import javax.security.auth.login.AppConfigurationEntry;
import javax.security.auth.login.Configuration;

import org.apache.commons.codec.digest.DigestUtils;

public class SaslConfiguration extends Configuration {

	public AppConfigurationEntry[] getAppConfigurationEntry(String name) {
		String appKey = "5kkyurvvtt58bbuxueee";//填APP KEY
		String secretKey = "rhj6na6u3y6uhy6qrbb3944mg5uqqpbb";//APP SECRET
		Map<String, String> options = new HashMap<String, String>();
		options.put("username", appKey);//APP KEY
		options.put("password", DigestUtils.md5Hex(appKey + DigestUtils.md5Hex(secretKey)).substring(8, 24));//MD5(APP KEY+MD5(云端APP SECRET))后，取中间16位
		AppConfigurationEntry entry = new AppConfigurationEntry(
				"org.apache.kafka.common.security.plain.PlainLoginModule",
				AppConfigurationEntry.LoginModuleControlFlag.REQUIRED, options);
		AppConfigurationEntry[] configurationEntries = new AppConfigurationEntry[1];
		configurationEntries[0] = entry;
		return configurationEntries;
	}
}>>>>>>> .r5268
