11.07.2015 Views

Thesis full text PDF (in Italian) - Politecnico di Milano

Thesis full text PDF (in Italian) - Politecnico di Milano

Thesis full text PDF (in Italian) - Politecnico di Milano

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Second registration phaseThe memorization of the new user’s <strong>in</strong>formation is performed by the servlet“UserRegistration” (fig. 26), that receives data through a client POST.The method “checkUserRegistration()”, evaluates if the user is already presentcalculat<strong>in</strong>g a hash function over the email’s value (<strong>in</strong> this way is created the user’sidentifier), and mak<strong>in</strong>g a comparison with all the ids of the users registered.If the user is not present, the registration of the new data is performed, and aconfirmation page is showed, else, the user is re<strong>di</strong>rect to a fail page, show<strong>in</strong>g thefailure’s motivations.Figure 26 - Class <strong>di</strong>agram related to the servlet“UserRegistration”Whether the user provides also his Facebook’s id, between the registration phaseand the confirmation page visualization, some ad<strong>di</strong>tional steps has to becomputed, this due to the fact that with Facebook, by default, an application canaccess all the user’s profile general <strong>in</strong>formation (<strong>in</strong>clud<strong>in</strong>g name, profile picture,gender, etc.) but, if it needs to access others <strong>in</strong>formation, that may be private, an“extended permissions” request, has to be performed.In order to authorize the application to get access to the user’s id, the Facebookplatform uses the OAuth 2.0 12 protocol, associat<strong>in</strong>g to each user an access token,used to get <strong>in</strong>formation from his profile.12 OAuth 2.0: is a simpler version of OAuth that leverages SSL for API communication <strong>in</strong>stead ofrely<strong>in</strong>g on complex URL signature schemes and token exchanges.73

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!