Welcome to FlowZap, the App to diagram with Speed, Clarity and Control.

身份验证流程工作流程

patterns

用户身份验证工作流程,包含**凭证验证**、**MFA 挑战**、**JWT 令牌生成**、**会话创建**和**失败尝试跟踪**。

完整 FlowZap 代码

User { # User
n1: circle label:"Start"
n2: rectangle label:"Enter credentials"
n3: rectangle label:"Submit login form"
n4: rectangle label:"Receive access token"
n5: rectangle label:"Access protected resource"
n6: circle label:"End"
n1.handle(right) -> n2.handle(left)
n2.handle(right) -> n3.handle(left)
n3.handle(bottom) -> AuthServer.n7.handle(top) [label="Login request"]
n4.handle(right) -> n5.handle(left)
n5.handle(right) -> n6.handle(left)
}
AuthServer { # Auth Server
n7: rectangle label:"Receive credentials"
n8: rectangle label:"Lookup user in database"
n9: diamond label:"User exists?"
n10: rectangle label:"Verify password hash"
n11: rectangle label:"Return invalid user"
n12: diamond label:"Password correct?"
n13: diamond label:"MFA enabled?"
n14: rectangle label:"Return invalid password"
n15: rectangle label:"Generate JWT token"
n7.handle(right) -> n8.handle(left)
n8.handle(right) -> n9.handle(left)
n9.handle(right) -> n10.handle(left) [label="Yes"]
n9.handle(bottom) -> n11.handle(top) [label="No"]
n10.handle(right) -> n12.handle(left)
n11.handle(top) -> User.n2.handle(bottom) [label="Try again"]
n12.handle(right) -> n13.handle(left) [label="Yes"]
n12.handle(bottom) -> n14.handle(top) [label="No"]
n13.handle(right) -> n15.handle(left) [label="No"]
n13.handle(bottom) -> MFA.n16.handle(top) [label="Yes"]
n14.handle(top) -> User.n2.handle(bottom) [label="Try again"]
n15.handle(top) -> User.n4.handle(bottom) [label="Token issued"]
}
MFA { # Multi-Factor Auth
n16: rectangle label:"Send OTP to device"
n17: rectangle label:"Verify OTP code"
n18: diamond label:"OTP valid?"
n19: rectangle label:"Return MFA failure"
n16.handle(right) -> n17.handle(left)
n17.handle(right) -> n18.handle(left)
n18.handle(right) -> AuthServer.n15.handle(bottom) [label="Yes"]
n18.handle(bottom) -> n19.handle(top) [label="No"]
n19.handle(top) -> User.n2.handle(bottom) [label="Retry"]
}

相关模板

API 网关工作流程

patterns

API 网关模式,包含**请求认证**、**速率限制**、**请求路由到后端服务**、**响应聚合**和**错误处理**。

批处理工作流

patterns

具有作业调度、基于块的处理、检查点/重启功能、错误处理和完成报告的批处理模式。