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


Java Account.setPassword方法代码示例

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


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

示例1: createUser

import com.stormpath.sdk.account.Account; //导入方法依赖的package包/类
/**
 * Create new user account with given username and password
 *
 * @param givenName given name of user
 * @param surname last name of user
 * @param email email of user
 * @param password password of user
 * @return Account instance of new user
 * @throws ResourceException
 */
public static Account createUser(String givenName, String surname, String email, String password) throws ResourceException {
    Account created = null;
    try {
        Account account = getStormpathClient().instantiate(Account.class);
        account.setGivenName(givenName);
        account.setSurname(surname);
        account.setEmail(email);
        account.setPassword(password);

        created = getStormpathApplicaiton().createAccount(account);
    } catch (ResourceException ex) {
        LOGGER.error("status: {} requestId: {} message: {} ", new Object[] { ex.getStatus(), ex.getRequestId(), ex.getMessage()});
        throw ex;
    }

    return created;
}
 
开发者ID:burakdede,项目名称:dropwizard-stormpath,代码行数:28,代码来源:StormpathApi.java

示例2: createAccount

import com.stormpath.sdk.account.Account; //导入方法依赖的package包/类
private Account createAccount(final String uname, final String pw) {
	// Create the account object
	Account account = client.instantiate(Account.class);

	// Set the account properties
	account.setGivenName("Bob");
	account.setSurname("Bobbin");
	account.setUsername(uname); // optional, defaults to email if unset
	account.setEmail("[email protected]");
	account.setPassword(pw);
	CustomData cd = account.getCustomData();
	cd.put("rank", "Captain");

	// Create the account using the existing Application object
	return application.createAccount(account);
}
 
开发者ID:IHTSDO,项目名称:OTF-User-Module,代码行数:17,代码来源:BasicTest.java

示例3: updateUserPassword

import com.stormpath.sdk.account.Account; //导入方法依赖的package包/类
public final int updateUserPassword(final String userNameIn,
		final String passwordIn, final String tokenIn) {
	Account acc = null;
	Application uApp = getUsersApplication(userNameIn);
	if (uApp != null) {
		acc = getApplicationByUser(userNameIn).verifyPasswordResetToken(
				tokenIn);
	}
	if (acc == null) {
		return -1;
	} else {
		// check username & acc username agree
		boolean namesMatch = userNameIn.equals(acc.getUsername());
		if (!namesMatch) {
			return -2;
		}
		if (namesMatch) {
			if (stringOK(passwordIn)) {
				acc.setPassword(passwordIn);
				acc.save();
				return 1;
			} else {
				return 0;
			}

		}
	}
	return -3;
}
 
开发者ID:IHTSDO,项目名称:OTF-User-Module,代码行数:30,代码来源:Storm2Model.java


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