Skip to main content

Posts

Showing posts with the label request

Weak software design - Restrict user access in the web applications

Today I want to talk about a smell that I way sometimes on web application. We will start with a short story to create a context for our smell. One day a request comes to the developer that he needs to create a page where the user can view a list of items. For each item the user can view details, edit an item and delete it. After a while the manager changes the request: “Only specific users can edit or delete items from the list”. Our developer based on the role of a user identifies what user can edit or delete items and for the rest of the user he decides to hide the two buttons. When we look over the code something is wrong. If the user knows the URL for the edit page of an item or for deletion, he can edit and delete any items even if is not an admin. We should never trust inputs that come from users. Every time we should validate on the server side the data from the user and also if he has rights to do execute a command or view a specific page. In MVC application is very simpl...

Mecanisme de autentificare: Security Token Service(STS) si Web Service Federation( WSF)

In momentul de fata aproape pe fiecare portal găsim mecanisme prin care putem să ne logam cu contul de Facebook, Y!, Google sau să facem anumite operațiuni folosind aceste conturi. Toate aceste funcționalități sunt oferite prin mecanisme gen Security Token Service (STS). STS a fost introdus de către Microsoft in 2005, in acest moment este folosit peste tot, inclusiv in aplicațiile din cloud( Windows Azure). Pe baza unui singur cont pe un anumit domeniu putem să accesam și să folosim n domenii pe baza unui singur cont. Pattern-ul de baza se numeste Brokered Authentication. Exista 3 jucători principali: clientul - care dorește sa acceseze un anumit domeniu; STS - serviciul care validează credențialele; Serviciul( domeniul) - pe care un client vrea să îl acceseze; Principiul de baza care sta la baza STS este următorul: clientul trimite o cerere de autentificare la STS( un mesaj cunoscut sub numele de Request Security Token ( RST)); STS verifica credentialele și trimite un mesaj de confirm...