[Building Sakai] Is there a way to get the username?

Matthew Jones matthew at longsight.com
Tue Jan 14 08:10:09 PST 2014


I agree, I think LTI would be the *best* way to go, and since the external
app is in PHP, it should be pretty easy to convert it over to except a
launch via LTI. Then the user can add the tool via LTI.

The web content tool supports passing user information as
macros/parameters, but it looks like Lessons uses URL links from resources
which don't. It would be probably be a useful feature if it did support
this (adding a URL into resources that had expanded parameters like web
content) and that doesn't seem like it would take a lot of effort, though
with this method anyone could pass whatever values they wanted without
verification.

I like the second idea better than the links. If the external service could
make a jsonp request back and get the data it needed, and then immediately
POST it, that would work too. This is kind of like what LTI does though
with additional verification, information and access to services in the
consumer. The current user is available in /direct/user but subject to same
origin policies.

You'd really want something that the user can't tamper with, unless you
were *only* using it for display purposes.


On Tue, Jan 14, 2014 at 10:52 AM, Noah Botimer <botimer at umich.edu> wrote:

> So, you're looking for a link that a learner would click to go to an
> external, personalized URL?
>
> There are a couple of ways to manage this...
>
> 1. Implement the IMS LTI spec on the external system so it is a Tool
> Provider -- this is the most complete and secure way, but obviously more
> involved
>
> 2. Implement a quick Servlet / EntityProvider to look up the current user
> and issue a redirect with the appropriate destination -- the links would be
> back to the Sakai instance (and be static, not including username)
>
> Depending on how user-friendly you need this to be, it may involve an
> addition to Lessons or a CKEditor plugin.
>
> Another hackish angle is that you can use the existing EntityProviders to
> get current user information via AJAX and rewrite the link or update
> window.location -- this would require some scripting mojo.
>
> Thanks,
> -Noah
>
> On Jan 14, 2014, at 10:18 AM, Paul Dagnall wrote:
>
> Adrian - Is the UserDirectoryService exposed to the content area editable
> by the ckeditor though? My goal is for content creators to be able to make
> lessonbuilder content that would include such a link.
>
> Paul Dagnall
> Application Developer & Administrator
> University of Dayton
>
>
> On Tue, Jan 14, 2014 at 10:01 AM, Adrian Fish <adrian.r.fish at gmail.com>wrote:
>
>> Hi Paul,
>>
>> So, you're rendering a link in a lessonbuilder page, and you want to
>> embed the current user's name in it? In that case, just use
>> UserDirectoryService.getCurrentUser, which will get you a Sakai User
>> object. You can then call getFirstName, getLastName and getEid on that
>> object.
>>
>> If you have a look in ShowPageProducer, you'll see examples of that
>> method in use.
>>
>> Cheers,
>> Adrian.
>>
>>
>>  On 14 January 2014 14:51, Paul Dagnall <pdagnall1 at udayton.edu> wrote:
>>
>>>  Hi
>>> Does anyone know of a way to get the current user's username and expose
>>> it so it can be accessed by that user from a sakai content page?
>>>
>>> There is an external system we are trying to access from a html link in
>>> the Lessons tool. Basically we'd like the link to be something like this:
>>>
>>> http://externalSystem.edu/program.php?userName=*<current user name>*
>>> &otherParam=value
>>>
>>> I know there's a webservice that will get me the user name if I have the
>>> session id, which I don't think is available in that scope.
>>>
>>> Thanks!
>>>
>>> Paul Dagnall
>>> Application Developer & Administrator
>>> University of Dayton
>>>
>>>
>>> _______________________________________________
>>> 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"
>
>
>
> _______________________________________________
> 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"
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20140114/236061cd/attachment.html 


More information about the sakai-dev mailing list