authentication_flow_diagram.svg•27 kB
<?xml version="1.0" encoding="us-ascii" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentStyleType="text/css" height="1387px" preserveAspectRatio="none" style="width:1397px;height:1387px;background:#FFFFFF;" version="1.1" viewBox="0 0 1397 1387" width="1397px" zoomAndPan="magnify"><defs/><g><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacing" textLength="309" x="540.25" y="27.9951">Google Chat MCP - Authentication Flow</text><rect fill="#FFFFFF" height="417.6641" style="stroke:#181818;stroke-width:1.0;" width="10" x="34" y="293.2578"/><rect fill="#FFFFFF" height="518.0625" style="stroke:#181818;stroke-width:1.0;" width="10" x="330" y="192.8594"/><rect fill="#FFFFFF" height="322.4609" style="stroke:#181818;stroke-width:1.0;" width="10" x="567" y="870.8516"/><rect fill="#FFFFFF" height="205.9297" style="stroke:#181818;stroke-width:1.0;" width="10" x="796" y="899.9844"/><rect fill="#FFFFFF" height="102.5313" style="stroke:#181818;stroke-width:1.0;" width="10" x="1096" y="432.9219"/><rect fill="#FFFFFF" height="29.1328" style="stroke:#181818;stroke-width:1.0;" width="10" x="1096" y="564.5859"/><rect fill="#FFFFFF" height="29.1328" style="stroke:#181818;stroke-width:1.0;" width="10" x="1096" y="1011.5156"/><rect fill="#FFFFFF" height="29.1328" style="stroke:#181818;stroke-width:1.0;" width="10" x="1096" y="1135.0469"/><rect fill="#F5F5F5" height="324.3984" style="stroke:#000000;stroke-width:1.5;" width="1370.5" x="10" y="379.5234"/><rect fill="#F5F5F5" height="43.9375" style="stroke:none;stroke-width:1.0;" width="1370.5" x="10" y="659.9844"/><rect fill="#F5F5F5" height="104.5313" style="stroke:#000000;stroke-width:1.5;" width="626.5" x="754" y="973.25"/><line style="stroke:#181818;stroke-width:0.5;" x1="39" x2="39" y1="118.5938" y2="1306.9766"/><line style="stroke:#181818;stroke-width:0.5;" x1="334.5" x2="334.5" y1="118.5938" y2="1306.9766"/><line style="stroke:#181818;stroke-width:0.5;" x1="572" x2="572" y1="118.5938" y2="1306.9766"/><line style="stroke:#181818;stroke-width:0.5;" x1="801" x2="801" y1="118.5938" y2="1306.9766"/><line style="stroke:#181818;stroke-width:0.5;" x1="1100.5" x2="1100.5" y1="118.5938" y2="1306.9766"/><line style="stroke:#181818;stroke-width:0.5;" x1="1223.5" x2="1223.5" y1="118.5938" y2="1306.9766"/><line style="stroke:#181818;stroke-width:0.5;" x1="1330.5" x2="1330.5" y1="118.5938" y2="1306.9766"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="32" x="20" y="115.292">User</text><ellipse cx="39" cy="50.7969" fill="#E2E2F0" rx="8" ry="8" style="stroke:#181818;stroke-width:0.5;"/><path d="M39,58.7969 L39,85.7969 M26,66.7969 L52,66.7969 M39,85.7969 L26,100.7969 M39,85.7969 L52,100.7969 " fill="none" style="stroke:#181818;stroke-width:0.5;"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="32" x="20" y="1318.9717">User</text><ellipse cx="39" cy="1330.7734" fill="#E2E2F0" rx="8" ry="8" style="stroke:#181818;stroke-width:0.5;"/><path d="M39,1338.7734 L39,1365.7734 M26,1346.7734 L52,1346.7734 M39,1365.7734 L26,1380.7734 M39,1365.7734 L52,1380.7734 " fill="none" style="stroke:#181818;stroke-width:0.5;"/><rect fill="#F8F8F8" height="46.5938" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="85" x="292.5" y="71"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="71" x="299.5" y="90.9951">Local Auth</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="44" x="313" y="107.292">Server</text><rect fill="#F8F8F8" height="46.5938" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="85" x="292.5" y="1305.9766"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="71" x="299.5" y="1325.9717">Local Auth</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="44" x="313" y="1342.2686">Server</text><rect fill="#F8F8F8" height="46.5938" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="100" x="522" y="71"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="86" x="529" y="90.9951">Google Chat</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="79" x="532.5" y="107.292">MCP Server</text><rect fill="#F8F8F8" height="46.5938" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="100" x="522" y="1305.9766"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="86" x="529" y="1325.9717">Google Chat</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="79" x="532.5" y="1342.2686">MCP Server</text><rect fill="#F8F8F8" height="46.5938" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="74" x="764" y="71"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="44" x="779" y="90.9951">Token</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="60" x="771" y="107.292">Manager</text><rect fill="#F8F8F8" height="46.5938" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="74" x="764" y="1305.9766"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="44" x="779" y="1325.9717">Token</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="60" x="771" y="1342.2686">Manager</text><rect fill="#F8F8F8" height="46.5938" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="111" x="1045.5" y="71"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="97" x="1052.5" y="90.9951">Google OAuth</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="50" x="1076" y="107.292">Service</text><rect fill="#F8F8F8" height="46.5938" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="111" x="1045.5" y="1305.9766"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="97" x="1052.5" y="1325.9717">Google OAuth</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="50" x="1076" y="1342.2686">Service</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="109" x="1166.5" y="115.292">credentials.json</text><path d="M1206,66.2969 C1206,56.2969 1224,56.2969 1224,56.2969 C1224,56.2969 1242,56.2969 1242,66.2969 L1242,92.2969 C1242,102.2969 1224,102.2969 1224,102.2969 C1224,102.2969 1206,102.2969 1206,92.2969 L1206,66.2969 " fill="#E2E2F0" style="stroke:#181818;stroke-width:1.5;"/><path d="M1206,66.2969 C1206,76.2969 1224,76.2969 1224,76.2969 C1224,76.2969 1242,76.2969 1242,66.2969 " fill="none" style="stroke:#181818;stroke-width:1.5;"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="109" x="1166.5" y="1318.9717">credentials.json</text><path d="M1206,1332.2734 C1206,1322.2734 1224,1322.2734 1224,1322.2734 C1224,1322.2734 1242,1322.2734 1242,1332.2734 L1242,1358.2734 C1242,1368.2734 1224,1368.2734 1224,1368.2734 C1224,1368.2734 1206,1368.2734 1206,1358.2734 L1206,1332.2734 " fill="#E2E2F0" style="stroke:#181818;stroke-width:1.5;"/><path d="M1206,1332.2734 C1206,1342.2734 1224,1342.2734 1224,1342.2734 C1224,1342.2734 1242,1342.2734 1242,1332.2734 " fill="none" style="stroke:#181818;stroke-width:1.5;"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="73" x="1291.5" y="115.292">token.json</text><path d="M1313,66.2969 C1313,56.2969 1331,56.2969 1331,56.2969 C1331,56.2969 1349,56.2969 1349,66.2969 L1349,92.2969 C1349,102.2969 1331,102.2969 1331,102.2969 C1331,102.2969 1313,102.2969 1313,92.2969 L1313,66.2969 " fill="#E2E2F0" style="stroke:#181818;stroke-width:1.5;"/><path d="M1313,66.2969 C1313,76.2969 1331,76.2969 1331,76.2969 C1331,76.2969 1349,76.2969 1349,66.2969 " fill="none" style="stroke:#181818;stroke-width:1.5;"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="73" x="1291.5" y="1318.9717">token.json</text><path d="M1313,1332.2734 C1313,1322.2734 1331,1322.2734 1331,1322.2734 C1331,1322.2734 1349,1322.2734 1349,1332.2734 L1349,1358.2734 C1349,1368.2734 1331,1368.2734 1331,1368.2734 C1331,1368.2734 1313,1368.2734 1313,1358.2734 L1313,1332.2734 " fill="#E2E2F0" style="stroke:#181818;stroke-width:1.5;"/><path d="M1313,1332.2734 C1313,1342.2734 1331,1342.2734 1331,1342.2734 C1331,1342.2734 1349,1342.2734 1349,1332.2734 " fill="none" style="stroke:#181818;stroke-width:1.5;"/><rect fill="#FFFFFF" height="417.6641" style="stroke:#181818;stroke-width:1.0;" width="10" x="34" y="293.2578"/><rect fill="#FFFFFF" height="518.0625" style="stroke:#181818;stroke-width:1.0;" width="10" x="330" y="192.8594"/><rect fill="#FFFFFF" height="322.4609" style="stroke:#181818;stroke-width:1.0;" width="10" x="567" y="870.8516"/><rect fill="#FFFFFF" height="205.9297" style="stroke:#181818;stroke-width:1.0;" width="10" x="796" y="899.9844"/><rect fill="#FFFFFF" height="102.5313" style="stroke:#181818;stroke-width:1.0;" width="10" x="1096" y="432.9219"/><rect fill="#FFFFFF" height="29.1328" style="stroke:#181818;stroke-width:1.0;" width="10" x="1096" y="564.5859"/><rect fill="#FFFFFF" height="29.1328" style="stroke:#181818;stroke-width:1.0;" width="10" x="1096" y="1011.5156"/><rect fill="#FFFFFF" height="29.1328" style="stroke:#181818;stroke-width:1.0;" width="10" x="1096" y="1135.0469"/><rect fill="#EEEEEE" height="3" style="stroke:#EEEEEE;stroke-width:1.0;" width="1390.5" x="0" y="149.1602"/><line style="stroke:#000000;stroke-width:1.0;" x1="0" x2="1390.5" y1="149.1602" y2="149.1602"/><line style="stroke:#000000;stroke-width:1.0;" x1="0" x2="1390.5" y1="152.1602" y2="152.1602"/><rect fill="#EEEEEE" height="23.1328" style="stroke:#000000;stroke-width:2.0;" width="157" x="616.75" y="138.5938"/><text fill="#000000" font-family="sans-serif" font-size="13" font-weight="bold" lengthAdjust="spacing" textLength="138" x="622.75" y="154.6606">Initial OAuth Setup</text><polygon fill="#181818" points="318,188.8594,328,192.8594,318,196.8594,322,192.8594" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.5;" x1="39" x2="324" y1="192.8594" y2="192.8594"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="217" x="46" y="187.7935">Run "python server.py -local-auth"</text><line style="stroke:#181818;stroke-width:1.5;" x1="340" x2="382" y1="221.9922" y2="221.9922"/><line style="stroke:#181818;stroke-width:1.5;" x1="382" x2="382" y1="221.9922" y2="234.9922"/><line style="stroke:#181818;stroke-width:1.5;" x1="341" x2="382" y1="234.9922" y2="234.9922"/><polygon fill="#181818" points="351,230.9922,341,234.9922,351,238.9922,347,234.9922" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="213" x="347" y="216.9263">Start FastAPI server on port 8000</text><polygon fill="#181818" points="50,260.125,40,264.125,50,268.125,46,264.125" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.5;" x1="44" x2="329" y1="264.125" y2="264.125"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="267" x="56" y="259.0591">Server ready at http://localhost:8000/auth</text><polygon fill="#181818" points="318,289.2578,328,293.2578,318,297.2578,322,293.2578" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.5;" x1="44" x2="324" y1="293.2578" y2="293.2578"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="142" x="51" y="288.1919">Access /auth endpoint</text><line style="stroke:#181818;stroke-width:1.5;" x1="340" x2="382" y1="322.3906" y2="322.3906"/><line style="stroke:#181818;stroke-width:1.5;" x1="382" x2="382" y1="322.3906" y2="335.3906"/><line style="stroke:#181818;stroke-width:1.5;" x1="341" x2="382" y1="335.3906" y2="335.3906"/><polygon fill="#181818" points="351,331.3906,341,335.3906,351,339.3906,347,335.3906" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="153" x="347" y="317.3247">Check for existing token</text><polygon fill="#181818" points="1212,360.5234,1222,364.5234,1212,368.5234,1216,364.5234" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.5;" x1="340" x2="1218" y1="364.5234" y2="364.5234"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="144" x="347" y="359.4575">Read client credentials</text><path d="M10,379.5234 L74,379.5234 L74,386.6563 L64,396.6563 L10,396.6563 L10,379.5234 " fill="#EEEEEE" style="stroke:#000000;stroke-width:1.5;"/><rect fill="none" height="324.3984" style="stroke:#000000;stroke-width:1.5;" width="1370.5" x="10" y="379.5234"/><text fill="#000000" font-family="sans-serif" font-size="13" font-weight="bold" lengthAdjust="spacing" textLength="19" x="25" y="392.5903">alt</text><text fill="#000000" font-family="sans-serif" font-size="11" font-weight="bold" lengthAdjust="spacing" textLength="228" x="89" y="391.7339">[No token exists or token is invalid]</text><polygon fill="#181818" points="1084,428.9219,1094,432.9219,1084,436.9219,1088,432.9219" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.5;" x1="340" x2="1090" y1="432.9219" y2="432.9219"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="212" x="347" y="412.7231">OAuth request with offline access</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="255" x="347" y="427.856">(access_type=offline, prompt=consent)</text><polygon fill="#181818" points="55,458.0547,45,462.0547,55,466.0547,51,462.0547" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.5;" x1="49" x2="1095" y1="462.0547" y2="462.0547"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="220" x="61" y="456.9888">Redirect to Google consent screen</text><polygon fill="#181818" points="1084,502.3203,1094,506.3203,1084,510.3203,1088,506.3203" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.5;" x1="44" x2="1090" y1="506.3203" y2="506.3203"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="256" x="51" y="486.1216">Grant permissions for requested scopes</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="139" x="51" y="501.2544">(Chat API, People API)</text><polygon fill="#181818" points="351,531.4531,341,535.4531,351,539.4531,347,535.4531" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.5;" x1="345" x2="1100" y1="535.4531" y2="535.4531"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="258" x="357" y="530.3872">Redirect to /auth/callback with auth code</text><polygon fill="#181818" points="1084,560.5859,1094,564.5859,1084,568.5859,1088,564.5859" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.5;" x1="340" x2="1090" y1="564.5859" y2="564.5859"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="339" x="347" y="559.52">Exchange code for tokens with refresh_token request</text><polygon fill="#181818" points="351,589.7188,341,593.7188,351,597.7188,347,593.7188" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.5;" x1="345" x2="1100" y1="593.7188" y2="593.7188"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="297" x="357" y="588.6528">Return access_token + refresh_token + expiry</text><polygon fill="#181818" points="1319,618.8516,1329,622.8516,1319,626.8516,1323,622.8516" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.5;" x1="340" x2="1325" y1="622.8516" y2="622.8516"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="166" x="347" y="617.7856">Save tokens to token.json</text><polygon fill="#181818" points="55,647.9844,45,651.9844,55,655.9844,51,651.9844" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.5;" x1="49" x2="329" y1="651.9844" y2="651.9844"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="163" x="61" y="646.9185">Authentication successful</text><line style="stroke:#000000;stroke-width:1.0;stroke-dasharray:2.0,2.0;" x1="10" x2="1380.5" y1="660.9844" y2="660.9844"/><text fill="#000000" font-family="sans-serif" font-size="11" font-weight="bold" lengthAdjust="spacing" textLength="169" x="15" y="671.1948">[Token exists and is valid]</text><polygon fill="#181818" points="55,691.9219,45,695.9219,55,699.9219,51,695.9219" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.5;" x1="49" x2="329" y1="695.9219" y2="695.9219"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="141" x="61" y="690.856">Already authenticated</text><path d="M340,715.9219 L340,800.9219 L686,800.9219 L686,725.9219 L676,715.9219 L340,715.9219 " fill="#FFFFEE" style="stroke:#999999;stroke-width:0.5;"/><path d="M676,715.9219 L676,725.9219 L686,725.9219 L676,715.9219 " fill="#FFFFEE" style="stroke:#999999;stroke-width:0.5;"/><text fill="#000000" font-family="sans-serif" font-size="13" font-weight="bold" lengthAdjust="spacing" textLength="222" x="346" y="732.9888">OAuth Implementation Details</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="325" x="346" y="748.1216">- Uses InstalledAppFlow from google_auth_oauthlib</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="289" x="346" y="763.2544">- Requests offline access to get refresh token</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="307" x="346" y="778.3872">- Forces consent screen to ensure refresh token</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="240" x="346" y="793.52">- Securely stores tokens in token.json</text><rect fill="#EEEEEE" height="3" style="stroke:#EEEEEE;stroke-width:1.0;" width="1390.5" x="0" y="827.1523"/><line style="stroke:#000000;stroke-width:1.0;" x1="0" x2="1390.5" y1="827.1523" y2="827.1523"/><line style="stroke:#000000;stroke-width:1.0;" x1="0" x2="1390.5" y1="830.1523" y2="830.1523"/><rect fill="#EEEEEE" height="23.1328" style="stroke:#000000;stroke-width:2.0;" width="216" x="587.25" y="816.5859"/><text fill="#000000" font-family="sans-serif" font-size="13" font-weight="bold" lengthAdjust="spacing" textLength="197" x="593.25" y="832.6528">MCP Server Authentication</text><polygon fill="#181818" points="555,866.8516,565,870.8516,555,874.8516,559,870.8516" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.5;" x1="39" x2="561" y1="870.8516" y2="870.8516"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="286" x="46" y="865.7856">AI Assistant makes Google Chat tool request</text><polygon fill="#181818" points="784,895.9844,794,899.9844,784,903.9844,788,899.9844" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.5;" x1="577" x2="790" y1="899.9844" y2="899.9844"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="200" x="584" y="894.9185">Need authentication for API call</text><polygon fill="#181818" points="1319,925.1172,1329,929.1172,1319,933.1172,1323,929.1172" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.5;" x1="806" x2="1325" y1="929.1172" y2="929.1172"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="209" x="813" y="924.0513">Load credentials from token.json</text><polygon fill="#181818" points="817,954.25,807,958.25,817,962.25,813,958.25" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.5;" x1="811" x2="1330" y1="958.25" y2="958.25"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="161" x="823" y="953.1841">Return stored credentials</text><path d="M754,973.25 L818,973.25 L818,980.3828 L808,990.3828 L754,990.3828 L754,973.25 " fill="#EEEEEE" style="stroke:#000000;stroke-width:1.5;"/><rect fill="none" height="104.5313" style="stroke:#000000;stroke-width:1.5;" width="626.5" x="754" y="973.25"/><text fill="#000000" font-family="sans-serif" font-size="13" font-weight="bold" lengthAdjust="spacing" textLength="19" x="769" y="986.3169">alt</text><text fill="#000000" font-family="sans-serif" font-size="11" font-weight="bold" lengthAdjust="spacing" textLength="161" x="833" y="985.4604">[Access token is expired]</text><polygon fill="#181818" points="1084,1007.5156,1094,1011.5156,1084,1015.5156,1088,1011.5156" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.5;" x1="806" x2="1090" y1="1011.5156" y2="1011.5156"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="271" x="813" y="1006.4497">Request token refresh using refresh_token</text><polygon fill="#181818" points="817,1036.6484,807,1040.6484,817,1044.6484,813,1040.6484" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.5;" x1="811" x2="1100" y1="1040.6484" y2="1040.6484"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="162" x="823" y="1035.5825">Return new access_token</text><polygon fill="#181818" points="1319,1065.7813,1329,1069.7813,1319,1073.7813,1323,1069.7813" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.5;" x1="806" x2="1325" y1="1069.7813" y2="1069.7813"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="266" x="813" y="1064.7153">Update token.json with new access_token</text><polygon fill="#181818" points="588,1101.9141,578,1105.9141,588,1109.9141,584,1105.9141" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.5;" x1="582" x2="800" y1="1105.9141" y2="1105.9141"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="154" x="594" y="1100.8481">Provide valid credentials</text><polygon fill="#181818" points="1084,1131.0469,1094,1135.0469,1084,1139.0469,1088,1135.0469" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.5;" x1="577" x2="1090" y1="1135.0469" y2="1135.0469"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="268" x="584" y="1129.981">Make Google Chat API call with valid token</text><polygon fill="#181818" points="588,1160.1797,578,1164.1797,588,1168.1797,584,1164.1797" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.5;" x1="582" x2="1100" y1="1164.1797" y2="1164.1797"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="83" x="594" y="1159.1138">API response</text><polygon fill="#181818" points="50,1189.3125,40,1193.3125,50,1197.3125,46,1193.3125" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.5;" x1="44" x2="571" y1="1193.3125" y2="1193.3125"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="178" x="56" y="1188.2466">Return result to AI Assistant</text><path d="M806,1206.3125 L806,1291.3125 L1148,1291.3125 L1148,1216.3125 L1138,1206.3125 L806,1206.3125 " fill="#FFFFEE" style="stroke:#999999;stroke-width:0.5;"/><path d="M1138,1206.3125 L1138,1216.3125 L1148,1216.3125 L1138,1206.3125 " fill="#FFFFEE" style="stroke:#999999;stroke-width:0.5;"/><text fill="#000000" font-family="sans-serif" font-size="13" font-weight="bold" lengthAdjust="spacing" textLength="146" x="812" y="1223.3794">Token Management</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="226" x="812" y="1238.5122">- Automatically checks token expiry</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="178" x="812" y="1253.645">- Handles refresh token flow</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="308" x="812" y="1268.7778">- Updates stored tokens with new access tokens</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="321" x="812" y="1283.9106">- Uses Credentials from google.oauth2.credentials</text><!--SRC=[bLTHRzis47xNhpXu3rdHEia65EY2Ee2RBLc0j0lY57i9O33IsU8ianf99JM6_VVTaPH4oMwGEK1YKtV7k-_k-yuvoexWIkjrXN1H2WUVBsvX2lF6bQYSp8MJMi5bfP-peoop6wbgOSGM_ia0FebyipQwKSM5hhI1vr8wfFC5_jsWod5kZ7w-BsM-KMWj_7JyFdbuHOxr9rtinb7-v2YBhTvmg5jXA0bP2-N6TZ-iFl0F6NtH3lUVqWknVQfDWIO- -SM_wCcDNE6DLBXmHZXSxy3gIXRPlrdcf2Cy9g_2PP9b8dSK-Aj50y92Gt-pkayS9ZSw5vNtVL0BD4ze9cmew61f_UUXVNBlW-AB4wTjNX_qkIV055aB9TRHrF7HSXjE3jxmHv-JpD4xhVsJh11EF0fB8EG62ovPLFRuBwkLj-93krp9WQM_hxS9rtkRR3Q3QoKvIBYJAd9D3RDPbZ5SC3rFqO0pk6iKJEgTAmdbS7XSxs1QCP9JDfqmwlA96ZV0COso5tJX20Eu5DRDRwzZMA0BQat77qvFJyVkFhUp23yO5CKEQ1PAv-gpanEVJAcjEsFV4_RzNZdpF6SAU1j0LTHQAjTNu4VcnTGlIimtiA8nms_IEgdM0T-nLzyO1f4IXhoIr3v8saW3MpdYHOWG0bgWqE6pj23Las0g0Br65uJveE2XZuRfR1qyI_gWLwkA-0J2L_kWVWnlbcvNuom-V0UrqTlQpNAjB2Nq9bpI8X77Zy_YJNqRxh2G1dD7URQI5OE0fV8837Ph6z0bUcLuv6iqMsajiTPw66FYM92lhf6pzJodoNW7jwXhygNtRqQfZAOqoSZtzeGcedeaBGg0-7RdkWW55NYep1T1_krRNWgrHX_4v-rxP4DuWok3jbo6liMANe7dk0ZN60LjhtoijwFORsbAQcbs_xEENWAOHU89s_HT73wl5eSyOyj7UciRd-IggJAiI7Bkqm4Mgk3P_UxajY6hoEC-D1OPSJ9Bwaeb9JdsFCqKRHGmSbqwclY1AS37n_D0ZEijJT2MBWYP_ufEoCf-F7ay9wifBmjBacWTpGiMyxhcLG8heaR4TEdZQlvToKVlSnSQR4SyOp3NwDgEHLrWXqjjo6144ZQd5ZG63tWiCAS75Qr2scXestP9bRQBi0B6mCjwlvx6pKh5lTzQt85hc1CJgNPAQYisT4-wQPtMLJVC7VJ9tak2TJCMjnn5_uB4QJ5CXOd3ai_ix4CEz-CmpdXuRpHBQQ-XeLK9A8drWQGYnpognRuMpzj6HltrPCCmnNjvTU8Gvm5Q-eTcDfQNmu2-hv24xoIiy7aW32_m_sNyljP51xa7B2ZONdpcuNuh1kDpQ_IJ93NqH1zWcIGsxErmOZe0FzFi3KQldP6GNBWWhjbHnJromz6c08HxpOpBzd4Qvj6jDGyrkJMLtoGfFz8W2GL66ZIirgjGaCRmTP1bg5CUOgdU2gP6HJpF-Nk5xRu9H8sVmk-afXKHSo0HiEB_0xny-NRQTg3JfTItD1xtUdSnva-0vTYhtC_7QIixZVaF]--></g></svg>