[Building Sakai] EB client example code?

Aaron Zeckoski azeckoski at unicon.net
Tue Jul 17 06:48:41 PDT 2012


EB generally delegates the auth to Sakai.

>From /direct/src/java/org/sakaiproject/entitybroker/servlet/SakaiDirectServlet.java

    public void handleUserLogin(HttpServletRequest req,
HttpServletResponse res, String path) {
        // attempt basic auth first
        try {
            if (basicAuth.doAuth(req, res)) {
                return;
            }
        } catch (IOException ioe) {
            throw new RuntimeException("IO Exception intercepted
during logon ", ioe);
        }

        // get the Sakai session (using the cover)
        Session session = SessionManager.getCurrentSession();
....

So you will need to have basic auth enabled to use the basic auth
portion. In that same way, you have to have the session keys enabled
to use that part. Otherwise you have login directly in the same way
you would for the access servlet (using normal user/pass challenge).

-AZ


On Tue, Jul 17, 2012 at 9:24 AM, Bryan Holladay <holladay at longsight.com> wrote:
> (I accidentally replied to a different email.  This is the one I
> really meant to reply to.)
>
> I just had this problem when trying to test MSGCNTR-687... I haven't
> tried this, but this is what Mar Savitisky suggested:
>
> Is basic auth turned on in your sakai configuration?
>
> #allow basic auth
> allow.basic.auth.login=true
>
>
>
>
> On Mon, Jul 16, 2012 at 7:30 AM, David Horwitz <david.horwitz at uct.ac.za> wrote:
>> Hi All,
>>
>> Anyone got example code for talking to the EB REST endpoints from Java?
>> Looking to at an intergration from another system and can't seem to get
>> the auth to work. Pretty sure there is some basic trick I'm missing ...
>>
>>
>> D
>>
>> _______________________________________________
>> sakai-dev mailing list
>> sakai-dev at collab.sakaiproject.org
>> http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
>>
>> TO UNSUBSCRIBE: send email to sakai-dev-unsubscribe at collab.sakaiproject.org with a subject of "unsubscribe"
> _______________________________________________
> sakai-dev mailing list
> sakai-dev at collab.sakaiproject.org
> http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
>
> TO UNSUBSCRIBE: send email to sakai-dev-unsubscribe at collab.sakaiproject.org with a subject of "unsubscribe"



-- 
Aaron Zeckoski - Software Architect - http://tinyurl.com/azprofile


More information about the sakai-dev mailing list