2017-03-04 15:38:41 +01:00
<!DOCTYPE html>
< html lang = "fr" dir = "ltr" >
< head >
< meta http-equiv = "content-type" content = "text/html; charset=UTF-8" >
< meta charset = "utf-8" / >
< title > documentation:2.0:servertoserver< / title > <!-- //if:usedebianlibs
< link rel = "stylesheet" type = "text/css" href = "/javascript/bootstrap/css/bootstrap.min.css" / >
//elsif:useexternallibs
< link rel = "stylesheet" type = "text/css" href = "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" > < / script >
//elsif:cssminified
< link rel = "stylesheet" type = "text/css" href = "/static/bwr/bootstrap/dist/css/bootstrap.min.css" / >
//else --><!-- //endif -->
< meta name = "generator" content = "DokuWiki" / >
2017-03-14 17:19:38 +01:00
< meta name = "robots" content = "index,follow" / >
2017-03-04 15:38:41 +01:00
< meta name = "keywords" content = "documentation,2.0,servertoserver" / >
< link rel = "search" type = "application/opensearchdescription+xml" href = "lib/exe/opensearch.html" title = "LemonLDAP::NG" / >
< link rel = "start" href = "servertoserver.html" / >
< link rel = "contents" href = "servertoserver.html" title = "Sitemap" / >
< link rel = "stylesheet" type = "text/css" href = "lib/exe/css.php.t.bootstrap3.css" / >
< link rel = "stylesheet" type = "text/css" href = "/static/bwr/bootstrap/dist/css/bootstrap.css" / >
< script type = "text/javascript" > / * < ! [ C D A T A [ * / v a r N S = ' d o c u m e n t a t i o n : 2 . 0 ' ; v a r J S I N F O = { " i d " : " d o c u m e n t a t i o n : 2 . 0 : s e r v e r t o s e r v e r " , " n a m e s p a c e " : " d o c u m e n t a t i o n : 2 . 0 " } ;
/*!]]>*/< / script >
< script type = "text/javascript" charset = "utf-8" src = "lib/exe/js.php.t.bootstrap3.js" > < / script > <!-- //if:usedebianlibs
< script type = "text/javascript" src = "/javascript/jquery/jquery.min.js" > < / script >
//elsif:useexternallibs
< script type = "text/javascript" src = "http://code.jquery.com/jquery-2.2.0.min.js" > < / script >
//elsif:jsminified
< script type = "text/javascript" src = "/static/bwr/jquery/dist/jquery.min.js" > < / script >
//else -->
< script type = "text/javascript" src = "/static/bwr/jquery/dist/jquery.js" > < / script > <!-- //endif --> <!-- //if:usedebianlibs
< script type = "text/javascript" src = "/javascript/jquery-ui/jquery-ui.min.js" > < / script >
//elsif:useexternallibs
< script type = "text/javascript" src = "http://code.jquery.com/ui/1.10.4/jquery-ui.min.js" > < / script >
//elsif:jsminified
2018-03-08 13:29:31 +01:00
< script type = "text/javascript" src = "/static/bwr/jquery-ui/jquery-ui.min.js" > < / script >
2017-03-04 15:38:41 +01:00
//else -->
2018-03-08 13:29:31 +01:00
< script type = "text/javascript" src = "/static/bwr/jquery-ui/jquery-ui.js" > < / script > <!-- //endif -->
2017-03-04 15:38:41 +01:00
< / head >
< body >
< div class = "dokuwiki export container" >
< h1 class = "sectionedit1" id = "handling_server_webservice_calls" > Handling server webservice calls< / h1 >
< div class = "level1" >
< p >
In modern applications, web application may need to call some other web application on behalf of the connected users. There is three way to do it: the ugly and the smart.
< / p >
< p >
The ugly consists to give the cookie value to the webapp 1 which use it in cookie header of its request. Since version 2.0, LLNG gives a better way to do it using tokens with limited scope.
< / p >
< p >
< a href = "server_to_server.png_documentation_2.0_servertoserver.html" class = "media" title = "documentation:2.0:server_to_server.png" > < img src = "server_to_server.png" class = "media" title = "Kinematic" alt = "Kinematic" / > < / a >
< / p >
< / div > <!-- EDIT1 SECTION "Handling server webservice calls" [1 - 447] -->
< h2 class = "sectionedit2" id = "webapp1_handler_configuration" > Webapp1 handler configuration< / h2 >
< div class = "level2" >
< p >
Insert a header containing this value:
< / p >
< pre class = "code file perl" > token< span class = "br0" > (< / span > < span class = "re0" > $_session_id< / span > < span class = "sy0" > ,< / span > < span class = "st_h" > 'webapp2.example.com'< / span > < span class = "sy0" > ,< / span > < span class = "st_h" > 'webapp3.example.com'< / span > < span class = "br0" > )< / span > < / pre >
< p >
2017-03-07 19:03:53 +01:00
Webapp1 can read this header and use it in its requests in the < code > X-Llng-Token< / code > header. The token is build using the session ID and the list of authorized virtualhosts. The token is available only 30 seconds and only the listed virtualhosts.
2017-03-04 15:38:41 +01:00
< / p >
2017-03-07 19:03:53 +01:00
< / div > <!-- EDIT2 SECTION "Webapp1 handler configuration" [448 - 861] -->
2017-03-04 15:38:41 +01:00
< h2 class = "sectionedit3" id = "webapp2_handler_configuration" > Webapp2 handler configuration< / h2 >
< div class = "level2" >
< p >
Change handler type to “ServiceToken”. So it is able to manage both user and server connections. And that's all !
< / p >
2017-03-07 19:03:53 +01:00
< / div > <!-- EDIT3 SECTION "Webapp2 handler configuration" [862 - ] -->
2017-03-04 15:38:41 +01:00
< / div >
< / body >
< / html >