%%{init: {"theme": "base", "themeVariables": {"primaryColor": "#fabd2f", "primaryTextColor": "#282828", "primaryBorderColor": "#b57614", "lineColor": "#7c6f64", "secondaryColor": "#83a598", "tertiaryColor": "#b8bb26", "background": "#fbf1c7", "mainBkg": "#ebdbb2", "fontFamily": "Tahoma, sans-serif"}}}%% flowchart LR subgraph Era1["ยุค Password Sharing / Risky Access"] A["ให้รหัสผ่านกับแอปอื่นเสี่ยงสูง"] end subgraph Era2["ยุค OAuth / Delegated Authorization"] B["OAuth 2.0มอบสิทธิ์แบบ token"] C["Authorization Codeเหมาะกับเว็บ"] end subgraph Era3["ยุค OIDC / Identity Layer"] D["OpenID Connectยืนยันตัวตน"] E["ID Tokenข้อมูลผู้ใช้ใน JWT"] end A --> B --> C --> D --> E
%%{init: {"theme": "base", "themeVariables": {"primaryColor": "#fabd2f", "primaryTextColor": "#282828", "primaryBorderColor": "#b57614", "lineColor": "#7c6f64", "secondaryColor": "#83a598", "tertiaryColor": "#b8bb26", "background": "#fbf1c7", "mainBkg": "#ebdbb2", "fontFamily": "Tahoma, sans-serif"}}}%% sequenceDiagram participant U as User / ผู้ใช้ participant A as App / แอปเรา participant P as Provider / Google GitHub U->>A: Click Login A->>P: Redirect to authorize P->>U: Login and consent P-->>A: Authorization Code A->>P: Exchange code for tokens P-->>A: Access Token + ID Token A-->>U: Logged in