redirect(Box.getAuthUrl());
}
public static void boxAuthCallback(String code) {
BoxCredentials cred = Box.getCred(code);
BoxClient client = BoxClientFactory.create(cred.token);
BoxAccount account = client.getAccount();
User u = User.upsert(cred, account);
session.put(SessionKeys.TYPE, AccountType.BOX.name());
session.put(SessionKeys.UID, u.id);
session.put(SessionKeys.IP, request.remoteAddress);
redirectToOriginalURL();