You will need to provide a custom implementation of org.jboss.dna.graph.SecurityContext, wrap it in an instance of org.jboss.dna.jcr.SecurityContextCredentials, and pass it in to JcrRepository.login().
The SecurityContext interface only requires the implementor to have a user name, be able to test for the presence of a role, and invalidate the SecurityContext. It sounds like you have all of those.
I'm in between meetings, so I apologize for not compile-testing this code, but it would look something like this:
SecurityContext ctx = /* Instantiate your object here */; SecurityContextCredentials creds = new SecurityContextCredentials(ctx); Repository repository = /* Reference to your DNA repository */; Session session = repository.login(creds);
Please let us know if this approach works for you.
got it, that makes sense. I think the confusing part's that the Credentials interface defines no methods.