-
-
Save saulovenancio/7c7a2a7b249e7dcf18ef to your computer and use it in GitHub Desktop.
Automatically log user in...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Get our current resolver. | |
ResourceResolver resolver = request.getResourceResolver(); | |
// Adapt to an anonymous session and get the repo as anonymous. | |
JackrabbitSession session = (JackrabbitSession) resolver.adaptTo(Session.class); | |
Repository repository = session.getRepository(); | |
// Create a new session by logging into using the default admin username and password. | |
Session adminSession = repository.login(new SimpleCredentials("admin", "admin".toCharArray())); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment