Long description

Back

The following are the nine stages of instructions shown in the image:

Stage 1: login form sent to user.

Stage 2: POST process hyphen login and is labeled email equals ra@funwebdev dot com plus pass equals 12 "a" b S dollar.

Stage 3: Verify credentials.

Stage 4: Construct token open parenthesis typically performed by a third hyphen party library close parenthesis.

Stage 5: H T T P forward slash 1 dot 1 200 OK and is labeled open curly brace open double quotes token close double quotes colon open double quotes eyJO ellipsis fwY close double quotes close curly brace. Stage 6: Your JavaScript might store token in sessionStorage and attach token within header to future requests. In the next line, our JavaScript might instead save token as a cookie.

Stage 7: GET forward slash api forward slash portfolio and is labeled Authorization colon Bearer e y J O dots f W Y O R Cookie colon e y J O ellipsis f W Y dot.

Stage 8: Verify token. Third hyphen party library will ensure it single quote s not expired and that its other fields are correct. In the next line, Your application logic will decide whether this user has access rights.

Stage 9: H T T P forward slash 1 dot 1 200 O K and is labeled open curly brace open double quotes data close double quotes colon ellipsis open double quotes close double quotes.

A block titled server is shown on the right part of the image. The instructions in the stages 3, 4 and 8 are given here. An arrow from the server points towards the right, and the instruction on stage (1) is labeled on it. An arrow from the left points towards the server, and the instruction on stage 2 is labeled on it. An arrow from the server block points to the left, and the instruction on stage 5 is labeled on it. This arrow points to an another block within which the instruction on stage 6 is labeled. An arrow from this block points to the server, with the instruction on stage 7 labeled on it. An arrow from the server block points to the left, and the instruction on stage 9 is labeled on it.

Back