本文整理了Java中com.stormpath.sdk.application.Application.createAccount()
方法的一些代码示例,展示了Application.createAccount()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Application.createAccount()
方法的具体详情如下:
包路径:com.stormpath.sdk.application.Application
类名称:Application
方法名:createAccount
[英]Creates a new Account that may login to this application.
This is mostly a convenience method; it delegates creation to the Application's designated #getDefaultAccountStore(), and functions as follows:
代码示例来源:origin: dogeared/OZorkAuth
@RequestMapping(value = "/v1/r", method = RequestMethod.POST)
public CommandResponse register(@RequestBody Registration registration) {
if (
registration == null ||
Strings.isNullOrEmpty(registration.getGivenName()) || Strings.isNullOrEmpty(registration.getSurName()) ||
Strings.isNullOrEmpty(registration.getEmail()) || Strings.isNullOrEmpty(registration.getPassword())
) {
throw new RegistrationException("givenName, surName, email and password are all required to register.");
}
Account account = client.instantiate(Account.class);
account
.setEmail(registration.getEmail())
.setPassword(registration.getPassword())
.setGivenName(registration.getGivenName())
.setSurname(registration.getSurName());
account = application.createAccount(account);
CommandResponse res = new CommandResponse();
res.setStatus("SUCCESS");
String[] response = {
"Thank you for registering!",
account.getGivenName() + " " + account.getSurname(),
account.getEmail()
};
res.setResponse(response);
return res;
}
代码示例来源:origin: stormpath/stormpath-sdk-java
account = application.createAccount(account);
代码示例来源:origin: stormpath/stormpath-sdk-java
account = app.createAccount(account);
} else {
final Account[] accountHolder = new Account[]{account};
代码示例来源:origin: com.stormpath.sdk/stormpath-sdk-servlet
account = app.createAccount(account);
} else {
final Account[] accountHolder = new Account[]{account};
内容来源于网络,如有侵权,请联系作者删除!