This content has been marked as final.
Show 2 replies
-
1. Re: Creating very simple login credentials
bcarothers Sep 1, 2009 12:45 PM (in response to meetoblivion)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. -
2. Re: Creating very simple login credentials
meetoblivion Sep 1, 2009 2:21 PM (in response to meetoblivion)got it, that makes sense. I think the confusing part's that the Credentials interface defines no methods.