[Fiware-developer-experience] Client side

Pablo Fernández Moniz pablofernandezmoniz at gmail.com
Wed Jul 22 11:20:52 CEST 2015


Hi all,

We just upload the light client in GitHub:

In the current state, we had removed all the code from the server side,
therefore we dont have real authentication process.

Authentication must be implemented from the client side when its API is
ready.

On the other hand, we have converted the Jinja2 templates to static html
files.


Making requests to the restaurants API (or making them to the
authentication API in the future) have cross-domain issues. We suggest some
solutions:

* Add the header 'Access-Control-Allow-Origin: *' to the API responses.
* Use a proxy.
* Have the web and the API in the same domain.

For now, we provided a PHP proxy. The proxy url (which should be in the
same domain that the web application) must be set in the variable proxy at
the top of the restaurants_api.js file.


Following we explain how was the code before we removed our server side
part.

We used the bitergia IdM docker adding to the composer file using this
instructions:


authzforce:
    image: bitergia/authzforce:4.2.0
    expose:
        - "8080"

idm:
    image: bitergia/idm-keyrock:4.3.0
    links:
        - authzforce
    volumes:
        - /config
    expose:
        - "5000"


We developed a little Flask application as server. This application had a
method to authenticate users using the IdM. User info, as could be the
token, the identificator and roles, was saved in session variables.

Using these session variables the application decided which pages should be
shown.

At render time, we were using Jinja2 templates which allowed us to display
differents sections based on values of the variables.

The Flask application also implemented a proxy that allowed us to make AJAX
petititions to the restaurants API.


KR,

ULPGC Team
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.fiware.org/private/fiware-developer-experience/attachments/20150722/b6a2c9a1/attachment.html>


More information about the Fiware-developer-experience mailing list

You can get more information about our cookies and privacy policies clicking on the following links: Privacy policy   Cookies policy