[Seaside] Seaside, JWT and REST

Sebastian Heidbrink sebastian_heidbrink at yahoo.de
Wed Oct 21 20:44:01 UTC 2015


Okay,

I found some information that would at least give me a chance to not add 
additional load to my seaside server.
But unfortunately I can not find any documentation on the "ajax 
beforeSend" topic in Seaside's history.

How do I implement the "beforeSend" part of this script in Seaside?

<script type='text/javascript'>
// define vars
var url = 'https://...';

// ajax call
$.ajax({
     url: url,
     dataType : 'jsonp',
     beforeSend : function(xhr) {
       // set header if JWT is set
       if ($window.sessionStorage.token) {
           xhr.setRequestHeader("Authorization", "Bearer " + 
$window.sessionStorage.token);
       }

     },
     error : function() {
       // error handler
     },
     success: function(data) {
         // success handler
     }
});
</script>


Thank you!
Sebastian




Am 21.10.2015 um 11:26 schrieb Sebastian Heidbrink:
> Hi!
>
> I have a working JWT (JsonWebToken) protected Zinc based REST server.
> I do also have a Seaside server as a user platform.
>
> Now I would like to integrate some results of the REST interfaces of 
> the Zinc based server into my seaside frontend.
> How would I define an ajax call including a JWT token in Seaside that 
> populates a table rendered by seaside on/after page load?
>
> Thank you for any ideas!
> Sebastian
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>



More information about the seaside mailing list