felipead/http-token-auth

View on GitHub
doc/successful-token-authentication-diagram.txt

Summary

Maintainability
Test Coverage
# To generate a diagram, copy and paste this code at http://bramp.github.io/js-sequence-diagrams/

participant AUTHENTICATION SERVICE
participant USER APPLICATION
participant PHOTO SERVICE

Note left of USER APPLICATION: Authenticates user (OAuth)
USER APPLICATION->AUTHENTICATION SERVICE: User Credentials
Note left of AUTHENTICATION SERVICE: Checks user\ncredentials
AUTHENTICATION SERVICE->USER APPLICATION: Token Credentials

Note over USER APPLICATION: Needs to display user photos
USER APPLICATION->PHOTO SERVICE: Request with\nToken Authorization

Note right of PHOTO SERVICE: Validates token before\nserving requests
PHOTO SERVICE-->AUTHENTICATION SERVICE: "Is valid token?"
Note left of AUTHENTICATION SERVICE: Checks token\ncredentials
AUTHENTICATION SERVICE-->PHOTO SERVICE: "Yes!"

Note right of PHOTO SERVICE: Carries on
PHOTO SERVICE->USER APPLICATION: Successful Response