Overview
Initially, JCas was not defined to include a JAAS based authorization
mechanism. But one day, a colleague and friend of mine (Thanks to Radek!)
came to me and mentioned it would be nice to have JAAS included.
I had no experience with JAAS at that time but a rough idea of what it is.
I learned more about it a few weeks later when reading documentation from
Sun's Java Homepage. I quickly understood that configuring JAAS is somewhat
tricky and implementing a JAAS service even more, but integrating it with
JCas would be a perfect addendum. And it even required not much effort.
So it went in within a few hours.
How to configure JAAS
This section will not cover how to configure JAAS itself. You can easily
read that at Sun's
JAAS Documentation. Here we will concentrate on integrating JAAS
into JCas schemes.
First you need to setup a JAAS context as described in the Sun documentation
or whatever JAAS provider you want to integrate. Let's assume for now, your
context is named MY_JAAS_CONTEXT.
Now it is very simple: Just specify the context's name in the scheme's
definition:
...
<Scheme>
...
<Jaas>MY_JAAS_CONTEXT</Jaas>
...
</Scheme>
...
That's it. Please beware that you cannot have JDBC and JAAS authentication
at once in a single scheme. The scheme either uses JDBC or JAAS.
Another drawback (if you regard it that way) is that you can't have more than
one JAAS contexts within a single scheme.
|