clientApp.setError("Client name field is required!");
return handleInternalRedirect(clientApp);
}
MD5SequenceGenerator tokenGen = new MD5SequenceGenerator();
Principal principal = SecurityContextHolder.getContext().getAuthentication();
String consumerKey = clientApp.getConsumerKey();
if (StringUtils.isEmpty(consumerKey)) {
consumerKey = tokenGen
.generate((principal.getName() + clientApp.getClientName()).getBytes("UTF-8"));
}
String secretKey = tokenGen.generate(new SecureRandom().generateSeed(20));
Client clientInfo =
new Client(consumerKey, secretKey, clientApp.getClientName(), null);
clientInfo.setCallbackURI(clientApp.getCallbackURL());
clientInfo.setLoginName(principal.getName());