public TokenInfo createToken(Credentials credentials) {
if (credentials instanceof SimpleCredentials) {
final SimpleCredentials sc = (SimpleCredentials) credentials;
String userId = sc.getUserID();
CoreValueFactory valueFactory = contentSession.getCoreValueFactory();
try {
Tree userTree = userProvider.getAuthorizable(userId, Type.USER);
if (userTree != null) {
NodeUtil userNode = new NodeUtil(userTree, valueFactory);
NodeUtil tokenParent = userNode.getChild(TOKENS_NODE_NAME);