[{"data":1,"prerenderedAt":336},["ShallowReactive",2],{"navigation_docs":3,"-guides-backend-requirements":189,"-guides-backend-requirements-surround":331},[4,30,65,105,120,135,164,184],{"title":5,"icon":6,"path":7,"stem":8,"children":9,"page":6},"Getting started",false,"/getting-started","1.getting-started",[10,15,20,25],{"title":11,"path":12,"stem":13,"icon":14},"Introduction","/getting-started/introduction","1.getting-started/1.introduction","i-lucide-book-open",{"title":16,"path":17,"stem":18,"icon":19},"Installation","/getting-started/installation","1.getting-started/2.installation","i-lucide-download",{"title":21,"path":22,"stem":23,"icon":24},"Quick start","/getting-started/quick-start","1.getting-started/3.quick-start","i-lucide-rocket",{"title":26,"path":27,"stem":28,"icon":29},"Session Lab","/getting-started/session-lab","1.getting-started/4.session-lab","i-lucide-flask-conical",{"title":31,"icon":6,"path":32,"stem":33,"children":34,"page":6},"Concepts","/concepts","2.concepts",[35,40,45,50,55,60],{"title":36,"path":37,"stem":38,"icon":39},"How it works","/concepts/how-it-works","2.concepts/1.how-it-works","i-lucide-workflow",{"title":41,"path":42,"stem":43,"icon":44},"Sessions and tokens","/concepts/sessions-and-tokens","2.concepts/2.sessions-and-tokens","i-lucide-key-round",{"title":46,"path":47,"stem":48,"icon":49},"State and events","/concepts/state-and-events","2.concepts/3.state-and-events","i-lucide-radio",{"title":51,"path":52,"stem":53,"icon":54},"Token refresh","/concepts/token-refresh","2.concepts/4.token-refresh","i-lucide-refresh-cw",{"title":56,"path":57,"stem":58,"icon":59},"Storage","/concepts/storage","2.concepts/5.storage","i-lucide-hard-drive",{"title":61,"path":62,"stem":63,"icon":64},"Guarantees","/concepts/guarantees","2.concepts/6.guarantees","i-lucide-shield-check",{"title":66,"icon":6,"path":67,"stem":68,"children":69,"page":6},"Providers","/providers","3.providers",[70,75,80,85,90,95,100],{"title":71,"path":72,"stem":73,"icon":74},"Choosing a provider","/providers/choosing","3.providers/1.choosing","i-lucide-signpost",{"title":76,"path":77,"stem":78,"icon":79},"Credentials","/providers/credentials","3.providers/2.credentials","i-lucide-user-round-key",{"title":81,"path":82,"stem":83,"icon":84},"OAuth 2.0 and OpenID Connect","/providers/oauth2","3.providers/3.oauth2","i-lucide-shield",{"title":86,"path":87,"stem":88,"icon":89},"OAuth through your backend","/providers/backend-oauth","3.providers/4.backend-oauth","i-lucide-server",{"title":91,"path":92,"stem":93,"icon":94},"Google","/providers/google","3.providers/5.google","i-simple-icons-google",{"title":96,"path":97,"stem":98,"icon":99},"Apple","/providers/apple","3.providers/6.apple","i-simple-icons-apple",{"title":101,"path":102,"stem":103,"icon":104},"Custom providers","/providers/custom","3.providers/7.custom","i-lucide-puzzle",{"title":106,"icon":6,"path":107,"stem":108,"children":109,"page":6},"Flutter","/flutter","4.flutter",[110,115],{"title":111,"path":112,"stem":113,"icon":114},"Widgets","/flutter/widgets","4.flutter/1.widgets","i-lucide-layout-template",{"title":116,"path":117,"stem":118,"icon":119},"Routing","/flutter/routing","4.flutter/2.routing","i-lucide-route",{"title":121,"icon":6,"path":122,"stem":123,"children":124,"page":6},"HTTP","/http","5.http",[125,130],{"title":126,"path":127,"stem":128,"icon":129},"Dio","/http/dio","5.http/1.dio","i-lucide-arrow-left-right",{"title":131,"path":132,"stem":133,"icon":134},"Other HTTP clients","/http/other-clients","5.http/2.other-clients","i-lucide-plug-zap",{"title":136,"icon":6,"path":137,"stem":138,"children":139,"page":6},"Guides","/guides","6.guides",[140,145,150,155,159],{"title":141,"path":142,"stem":143,"icon":144},"Multiple accounts","/guides/multi-account","6.guides/1.multi-account","i-lucide-users",{"title":146,"path":147,"stem":148,"icon":149},"Sign-out and revocation","/guides/sign-out","6.guides/2.sign-out","i-lucide-log-out",{"title":151,"path":152,"stem":153,"icon":154},"Access policy","/guides/access-policy","6.guides/3.access-policy","i-lucide-shield-alert",{"title":156,"path":157,"stem":158,"icon":29},"Testing","/guides/testing","6.guides/4.testing",{"title":160,"path":161,"stem":162,"icon":163},"Backend requirements","/guides/backend-requirements","6.guides/5.backend-requirements","i-lucide-server-cog",{"title":165,"icon":6,"path":166,"stem":167,"children":168,"page":6},"Reference","/reference","7.reference",[169,174,179],{"title":170,"path":171,"stem":172,"icon":173},"API reference","/reference/api","7.reference/1.api","i-lucide-library",{"title":175,"path":176,"stem":177,"icon":178},"FAQ","/reference/faq","7.reference/2.faq","i-lucide-message-circle-question",{"title":180,"path":181,"stem":182,"icon":183},"Troubleshooting","/reference/troubleshooting","7.reference/3.troubleshooting","i-lucide-wrench",{"title":185,"path":186,"stem":187,"icon":188},"Changelog","/changelog","changelog","i-lucide-history",{"id":190,"title":160,"body":191,"description":324,"extension":325,"links":326,"meta":327,"navigation":328,"path":161,"seo":329,"stem":162,"__hash__":330},"docs/6.guides/5.backend-requirements.md",{"type":192,"value":193,"toc":314},"minimark",[194,198,203,211,222,226,272,279,283,286,289,293,300,304,307,311],[195,196,197],"p",{},"Authyra works with most token APIs. These choices on the server side make sessions reliable.",[199,200,202],"h2",{"id":201},"return-lifetimes","Return lifetimes",[195,204,205,206,210],{},"Send ",[207,208,209],"code",{},"expires_in"," with every access token. Without it, Authyra cannot refresh ahead of time and relies on 401 responses alone, which makes the first request after expiry slower.",[195,212,213,214,217,218,221],{},"If your refresh tokens expire, say when (",[207,215,216],{},"refresh_token_expires_in",", or an absolute date) and map it to ",[207,219,220],{},"refreshTokenExpiresAt",". Authyra then refreshes before the deadline so an idle app keeps its session.",[199,223,225],{"id":224},"answer-the-refresh-endpoint-precisely","Answer the refresh endpoint precisely",[227,228,229,242],"table",{},[230,231,232],"thead",{},[233,234,235,239],"tr",{},[236,237,238],"th",{},"Situation",[236,240,241],{},"Respond with",[243,244,245,261],"tbody",{},[233,246,247,251],{},[248,249,250],"td",{},"Refresh token unknown, expired, revoked or reused",[248,252,253,257,258],{},[254,255,256],"strong",{},"401",", or 400 with ",[207,259,260],{},"{\"error\": \"invalid_grant\"}",[233,262,263,266],{},[248,264,265],{},"Anything temporary: database down, rate limit, deploy",[248,267,268,269],{},"5xx or 429, ",[254,270,271],{},"never 401",[195,273,274,275,278],{},"The provider turns the first case into ",[207,276,277],{},"RefreshRevokedException",", which ends the session. A 401 sent for a temporary problem signs users out for no reason.",[199,280,282],{"id":281},"rotate-refresh-tokens","Rotate refresh tokens",[195,284,285],{},"Issuing a new refresh token on every refresh, and invalidating the old one, limits what a stolen token can do. Authyra makes rotation safe on the client: one refresh at a time, always with the latest token.",[195,287,288],{},"Reuse detection (revoking the whole session when an old refresh token comes back) is the strongest setting. A short grace period is a reasonable trade-off for clients you do not control, but not needed for Authyra.",[199,290,292],{"id":291},"revoke-on-sign-out","Revoke on sign-out",[195,294,295,296,299],{},"Expose an endpoint that invalidates a refresh token, and call it from your provider's ",[207,297,298],{},"signOut",". Make it idempotent: revoking an unknown token returns success.",[199,301,303],{"id":302},"keep-user-ids-stable","Keep user ids stable",[195,305,306],{},"The session key is the provider id plus the user id you return. Changing a user's id, or returning an email that can change, creates a second session for the same person.",[199,308,310],{"id":309},"verify-identity-tokens-on-the-server","Verify identity tokens on the server",[195,312,313],{},"For Google and Apple, the app sends an identity token to your backend. Verify its signature, audience, issuer and expiry before creating a session. The device never verifies tokens for you.",{"title":315,"searchDepth":316,"depth":316,"links":317},"",2,[318,319,320,321,322,323],{"id":201,"depth":316,"text":202},{"id":224,"depth":316,"text":225},{"id":281,"depth":316,"text":282},{"id":291,"depth":316,"text":292},{"id":302,"depth":316,"text":303},{"id":309,"depth":316,"text":310},"What your API should return so that sessions behave well on the device.","md",null,{},{"icon":163},{"title":160,"description":324},"X4HWETPIoysxtIWWytUtgMs6f59NIkK-RjCi7zpe9gU",[332,334],{"title":156,"path":157,"stem":158,"description":333,"icon":29,"children":-1},"Test your providers, your auth flows and your widgets without a network or a keystore.",{"title":170,"path":171,"stem":172,"description":335,"icon":173,"children":-1},"The full API documentation of each package, and the members you use most.",1794303130421]