---
# System prepended metadata

title: User FBL4B Integration

---

```plantuml

actor "user" as us
participant "F E" as fe
participant "everpro-\nfb-ads" as ap
participant "facebook" as fb
participant "redis" as redis
database " database" as db

us -> ap: request connect/reconnect\nour app to access ther fb

ap->redis: generate state data (id, token type and user id)

ap -> ap: generate link url\nto invoke user dialog
fe <- ap: return url link

us <- fe: open dialog url

us <- fb: \nrequest user approval (pop up)
us -> fb: approved

ap <- fb: send callback,\nreturn user token and state
ap -> fb: return ok

ap -> redis: get state by id
redis --> ap: state data
alt state data found
ap -> db: save token
ap->fe: redirect to success page
else
ap->fe: redirect to error page
end
