当前位置: 首页>>代码示例>>Java>>正文


Java SocialAuthManager.getCurrentAuthProvider方法代码示例

本文整理汇总了Java中org.brickred.socialauth.SocialAuthManager.getCurrentAuthProvider方法的典型用法代码示例。如果您正苦于以下问题:Java SocialAuthManager.getCurrentAuthProvider方法的具体用法?Java SocialAuthManager.getCurrentAuthProvider怎么用?Java SocialAuthManager.getCurrentAuthProvider使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.brickred.socialauth.SocialAuthManager的用法示例。


在下文中一共展示了SocialAuthManager.getCurrentAuthProvider方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: execute

import org.brickred.socialauth.SocialAuthManager; //导入方法依赖的package包/类
/**
 * Update status for the given provider.
 * 
 * @return String where the action should flow
 * @throws Exception
 *             if an error occurs
 */
@Action(value = "/socialAuthUploadPhotoAction")
public String execute() throws Exception {

	SASFHelper helper = SASFStaticHelper.getHelper(request);
	SocialAuthManager manager = helper.getAuthManager();

	AuthProvider provider = null;
	if (manager != null) {
		provider = manager.getCurrentAuthProvider();
	}
	if (provider != null) {
		try {
			provider.uploadImage(statusMessage, imageFileFileName,
					new FileInputStream(imageFile));
			request.setAttribute("Message", "Status Updated successfully");
			return "success";
		} catch (SocialAuthException e) {
			request.setAttribute("Message", e.getMessage());
			e.printStackTrace();
		}
	}
	return "failure";

}
 
开发者ID:3pillarlabs,项目名称:socialauth,代码行数:32,代码来源:SocialAuthUploadPhotoAction.java

示例2: getRedirectURL

import org.brickred.socialauth.SocialAuthManager; //导入方法依赖的package包/类
@RequestMapping(value = "/authSuccess")
public ModelAndView getRedirectURL(final HttpServletRequest request)
		throws Exception {
	SocialAuthManager manager = socialAuthTemplate.getSocialAuthManager();
	AuthProvider provider = manager.getCurrentAuthProvider();
	HttpSession session = request.getSession();
	String type = null;
	if (session.getAttribute(Constants.REQUEST_TYPE) != null) {
		type = (String) session.getAttribute(Constants.REQUEST_TYPE);
	}
	if (type != null) {
		if (Constants.REGISTRATION.equals(type)) {
			return registration(provider);
		} else if (Constants.IMPORT_CONTACTS.equals(type)) {
			return importContacts(provider);
		} else if (Constants.SHARE.equals(type)) {
			return new ModelAndView("shareForm", "connectedProvidersIds",
					manager.getConnectedProvidersIds());
		}
	}

	return null;
}
 
开发者ID:3pillarlabs,项目名称:socialauth,代码行数:24,代码来源:SuccessController.java

示例3: getProfile

import org.brickred.socialauth.SocialAuthManager; //导入方法依赖的package包/类
@Override
public Profile getProfile() {
	Profile profile = null;
	SocialAuthManager manager = getAuthManager();
	if (manager != null) {
		try {
			AuthProvider provider = manager.getCurrentAuthProvider();
			profile = provider.getUserProfile();

		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	return profile;
}
 
开发者ID:3pillarlabs,项目名称:socialauth,代码行数:16,代码来源:DefaultSASFHelper.java

示例4: getContactList

import org.brickred.socialauth.SocialAuthManager; //导入方法依赖的package包/类
@Override
public List<Contact> getContactList() {
	List<Contact> contactsList = null;
	SocialAuthManager manager = getAuthManager();
	if (manager != null) {
		contactsList = new ArrayList<Contact>();
		try {
			AuthProvider provider = manager.getCurrentAuthProvider();
			contactsList = provider.getContactList();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	return contactsList;
}
 
开发者ID:3pillarlabs,项目名称:socialauth,代码行数:16,代码来源:DefaultSASFHelper.java

示例5: execute

import org.brickred.socialauth.SocialAuthManager; //导入方法依赖的package包/类
/**
 * Update status for the given provider.
 * 
 * @return String where the action should flow
 * @throws Exception
 *             if an error occurs
 */
@Action(value = "/socialAuthUpdateStatusAction")
public String execute() throws Exception {

	if (statusMessage == null || statusMessage.trim().length() == 0) {
		request.setAttribute("Message", "Status can't be left blank.");
		return "failure";
	}
	SASFHelper helper = SASFStaticHelper.getHelper(request);
	SocialAuthManager manager = helper.getAuthManager();
	AuthProvider provider = null;
	if (manager != null) {
		provider = manager.getCurrentAuthProvider();
	}
	if (provider != null) {
		try {
			provider.updateStatus(statusMessage);
			request.setAttribute("Message", "Status Updated successfully");
			return "success";
		} catch (SocialAuthException e) {
			request.setAttribute("Message", e.getMessage());
			e.printStackTrace();
		}
	}
	return "failure";

}
 
开发者ID:3pillarlabs,项目名称:socialauth,代码行数:34,代码来源:SocialAuthUpdateStatusAction.java


注:本文中的org.brickred.socialauth.SocialAuthManager.getCurrentAuthProvider方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。