> 1. Use the attribute feature of SimpleCredentials to pass such parameters

+1 to this approach. It is currently also used in Sling to map the
authInfo map in ResourceResolverFactory [1]. The data passed is made
accessible later via Session.getAttribute [2].

To reduce hard dependency on SimpleCredentials the
setAttribute/getAttribute pair can be part of some interface which is
part of Oak JCR API. Internally the login method checks if its
SimpleCredentails or some credential which also implement the new
interface and handle it accordingly.

Chetan Mehrotra

[1] 
http://sling.apache.org/apidocs/sling6/org/apache/sling/api/resource/ResourceResolverFactory.html#getResourceResolver(java.util.Map)
[2] 
http://www.day.com/maven/jsr170/javadocs/jcr-2.0/javax/jcr/Session.html#getAttribute(java.lang.String)

Reply via email to