[{"data":1,"prerenderedAt":1937},["ShallowReactive",2],{"navigation_docs":3,"-providers-apple":265,"-providers-apple-surround":1932},[4,35,49,89,117,164,193,235,253,257,261],{"title":5,"icon":6,"path":7,"stem":8,"children":9,"page":6},"Getting Started",false,"/getting-started","1.getting-started",[10,15,20,25,30],{"title":11,"path":12,"stem":13,"icon":14},"Introduction","/getting-started/introduction","1.getting-started/2.introduction","i-lucide-house",{"title":16,"path":17,"stem":18,"icon":19},"Installation","/getting-started/installation","1.getting-started/3.installation","i-lucide-download",{"title":21,"path":22,"stem":23,"icon":24},"Quick Start","/getting-started/quick-start","1.getting-started/4.quick-start","i-lucide-rocket",{"title":26,"path":27,"stem":28,"icon":29},"Configuration","/getting-started/configuration","1.getting-started/5.configuration","i-lucide-sliders-horizontal",{"title":31,"path":32,"stem":33,"icon":34},"First Auth","/getting-started/first-auth","1.getting-started/6.first-auth","i-lucide-key-round",{"title":36,"path":37,"stem":38,"children":39,"page":6},"Migration","/migration","10.migration",[40,45],{"title":41,"path":42,"stem":43,"icon":44},"Migration depuis Firebase Auth","/migration/from-firebase","10.migration/1.from-firebase","i-lucide-arrow-right-left",{"title":46,"path":47,"stem":48,"icon":44},"Migration depuis Supabase Auth","/migration/from-supabase","10.migration/2.from-supabase",{"title":50,"path":51,"stem":52,"children":53,"page":6},"Core Concepts","/core-concepts","2.core-concepts",[54,59,64,69,74,79,84],{"title":55,"path":56,"stem":57,"icon":58},"Architecture","/core-concepts/architecture","2.core-concepts/1.architecture","i-lucide-layers",{"title":60,"path":61,"stem":62,"icon":63},"Providers","/core-concepts/providers","2.core-concepts/2.providers","i-lucide-plug",{"title":65,"path":66,"stem":67,"icon":68},"Sessions","/core-concepts/sessions","2.core-concepts/3.sessions","i-lucide-timer",{"title":70,"path":71,"stem":72,"icon":73},"Storage","/core-concepts/storage","2.core-concepts/4.storage","i-lucide-database",{"title":75,"path":76,"stem":77,"icon":78},"Reactivity","/core-concepts/reactivity","2.core-concepts/5.reactivity","i-lucide-activity",{"title":80,"path":81,"stem":82,"icon":83},"Callbacks","/core-concepts/callbacks","2.core-concepts/6.callbacks","i-lucide-shield-check",{"title":85,"path":86,"stem":87,"icon":88},"Events","/core-concepts/events","2.core-concepts/7.events","i-lucide-radio",{"title":60,"path":90,"stem":91,"children":92,"page":6},"/providers","3.providers",[93,97,101,105,109,113],{"title":94,"path":95,"stem":96},"Credentials Provider","/providers/credentials","3.providers/1.credentials",{"title":98,"path":99,"stem":100},"OAuth2 Provider","/providers/oauth2","3.providers/2.oauth2",{"title":102,"path":103,"stem":104},"Google Provider","/providers/google","3.providers/3.google",{"title":106,"path":107,"stem":108},"GitHub Provider","/providers/github","3.providers/4.github",{"title":110,"path":111,"stem":112},"Apple Provider","/providers/apple","3.providers/5.apple",{"title":114,"path":115,"stem":116},"Proxy OAuth Provider","/providers/proxy-oauth","3.providers/6.proxy-oauth",{"title":118,"path":119,"stem":120,"children":121,"page":6},"Guides","/guides","4.guides",[122,126,131,136,141,146,151,155,159],{"title":123,"path":124,"stem":125},"Email / Password Auth","/guides/email-auth","4.guides/1.email-auth",{"title":127,"path":128,"stem":129,"icon":130},"Custom OAuth2 Flow","/guides/oauth2-flow","4.guides/2.oauth2-flow","i-lucide-workflow",{"title":132,"path":133,"stem":134,"icon":135},"Deep Links & OAuth2 Callbacks","/guides/deep-links","4.guides/3.deep-links","i-lucide-link",{"title":137,"path":138,"stem":139,"icon":140},"Token Refresh","/guides/token-refresh","4.guides/4.token-refresh","i-lucide-refresh-cw",{"title":142,"path":143,"stem":144,"icon":145},"Multi-Account","/guides/multi-account","4.guides/5.multi-account","i-lucide-users",{"title":147,"path":148,"stem":149,"icon":150},"Route Protection","/guides/route-protection","4.guides/6.route-protection","i-lucide-lock",{"title":152,"path":153,"stem":154,"icon":63},"Custom Provider","/guides/custom-provider","4.guides/7.custom-provider",{"title":156,"path":157,"stem":158,"icon":73},"Custom Storage","/guides/custom-storage","4.guides/8.custom-storage",{"title":160,"path":161,"stem":162,"icon":163},"Testing","/guides/testing","4.guides/9.testing","i-lucide-flask-conical",{"title":165,"path":166,"stem":167,"children":168,"page":6},"Flutter","/flutter","5.flutter",[169,173,178,183,188],{"title":170,"path":171,"stem":172},"Flutter Setup","/flutter/setup","5.flutter/1.setup",{"title":174,"path":175,"stem":176,"icon":177},"Secure Storage","/flutter/secure-storage","5.flutter/2.secure-storage","i-lucide-vault",{"title":179,"path":180,"stem":181,"icon":182},"Widgets","/flutter/widgets","5.flutter/3.widgets","i-lucide-layout",{"title":184,"path":185,"stem":186,"icon":187},"Router Guard","/flutter/router-guard","5.flutter/4.router-guard","i-lucide-signpost",{"title":189,"path":190,"stem":191,"icon":192},"App Binding","/flutter/app-binding","5.flutter/5.app-binding","i-lucide-cpu",{"title":194,"path":195,"stem":196,"children":197,"page":6},"API Reference","/api-reference","6.api-reference",[198,202,206,211,216,221,225,230],{"title":199,"path":200,"stem":201},"AuthyraClient","/api-reference/authyra-client","6.api-reference/1.authyra-client",{"title":203,"path":204,"stem":205},"AuthyraInstance","/api-reference/authyra-instance","6.api-reference/2.authyra-instance",{"title":207,"path":208,"stem":209,"icon":210},"AccountManager","/api-reference/account-manager","6.api-reference/3.account-manager","i-lucide-users-round",{"title":212,"path":213,"stem":214,"icon":215},"AuthProvider","/api-reference/auth-provider","6.api-reference/4.auth-provider","i-lucide-plug-zap",{"title":217,"path":218,"stem":219,"icon":220},"AuthStorage","/api-reference/auth-storage","6.api-reference/5.auth-storage","i-lucide-hard-drive",{"title":222,"path":223,"stem":224,"icon":68},"AuthSession","/api-reference/auth-session","6.api-reference/6.auth-session",{"title":226,"path":227,"stem":228,"icon":229},"AuthState","/api-reference/auth-state","6.api-reference/7.auth-state","i-lucide-toggle-right",{"title":231,"path":232,"stem":233,"icon":234},"Exceptions","/api-reference/auth-exceptions","6.api-reference/8.auth-exceptions","i-lucide-triangle-alert",{"title":236,"path":237,"stem":238,"children":239,"page":6},"Examples","/examples","7.examples",[240,244,249],{"title":241,"path":242,"stem":243},"Flutter App Example","/examples/flutter-app","7.examples/1.flutter-app",{"title":245,"path":246,"stem":247,"icon":248},"Dart Backend","/examples/dart-backend","7.examples/2.dart-backend","i-lucide-server",{"title":250,"path":251,"stem":252,"icon":163},"Testing Setup","/examples/testing-setup","7.examples/3.testing-setup",{"title":254,"path":255,"stem":256},"Troubleshooting","/troubleshooting","8.troubleshooting",{"title":258,"path":259,"stem":260},"FAQ","/faq","9.faq",{"title":262,"path":263,"stem":264},"Changelog","/changelog","changelog",{"id":266,"title":110,"body":267,"description":1924,"extension":1925,"links":1926,"meta":1927,"navigation":960,"path":111,"seo":1928,"stem":112,"__hash__":1931},"docs/3.providers/5.apple.md",{"type":268,"value":269,"toc":1908},"minimark",[270,282,292,295,300,392,405,407,411,469,506,513,515,518,688,824,826,830,835,844,885,895,926,930,1330,1337,1341,1347,1364,1369,1371,1375,1522,1524,1528,1635,1637,1641,1653,1678,1680,1684,1693,1806,1808,1811,1819,1822,1845,1850,1866,1873,1878,1880,1884,1904],[271,272,273,277,278,281],"p",{},[274,275,276],"code",{},"AppleProvider"," implements Sign in with Apple using Apple's OAuth 2.0 Authorization Code flow. It handles the Apple-specific quirks automatically: ES256 JWT client secrets generated per-request, user profile decoded from the ",[274,279,280],{},"id_token"," (no userinfo endpoint), and first-sign-in name capture from the callback URL.",[271,283,284,288,289],{},[285,286,287],"strong",{},"Package",": ",[274,290,291],{},"authyra_flutter",[293,294],"hr",{},[296,297,299],"h2",{"id":298},"apple-specific-behaviour","Apple-specific behaviour",[301,302,303,316],"table",{},[304,305,306],"thead",{},[307,308,309,313],"tr",{},[310,311,312],"th",{},"Quirk",[310,314,315],{},"What Authyra does",[317,318,319,332,355,373,381],"tbody",{},[307,320,321,325],{},[322,323,324],"td",{},"No static client secret",[322,326,327,328,331],{},"Generates a short-lived ES256 JWT from your ",[274,329,330],{},".p8"," key on every token request",[307,333,334,337],{},[322,335,336],{},"No userinfo endpoint",[322,338,339,340,343,344,347,348,351,352,354],{},"Decodes ",[274,341,342],{},"sub",", ",[274,345,346],{},"email",", and ",[274,349,350],{},"email_verified"," from the ",[274,353,280],{}," JWT",[307,356,357,360],{},[322,358,359],{},"Name only on first sign-in",[322,361,362,363,351,366,369,370],{},"Extracts ",[274,364,365],{},"name",[274,367,368],{},"user"," callback parameter and folds it into ",[274,371,372],{},"AuthUser",[307,374,375,378],{},[322,376,377],{},"PKCE + nonce",[322,379,380],{},"Both enabled by default for replay protection",[307,382,383,386],{},[322,384,385],{},"Refresh token valid 6 months",[322,387,388,391],{},[274,389,390],{},"supportsRefresh: true","; Apple does not rotate the refresh token",[393,394,396,397,400,401,404],"callout",{"icon":395},"i-lucide-alert-triangle","Apple sends the user's name and email ",[285,398,399],{},"only on the first sign-in",". Persist ",[274,402,403],{},"user.name"," immediately after the first successful sign-in — you will not receive it again.",[293,406],{},[296,408,410],{"id":409},"constructor","Constructor",[412,413,418],"pre",{"className":414,"code":415,"language":416,"meta":417,"style":417},"language-dart shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","AppleProvider({\n  required AppleOAuthConfig config,\n  Dio? dio,\n})\n","dart","",[274,419,420,432,449,463],{"__ignoreMap":417},[421,422,425,428],"span",{"class":423,"line":424},"line",1,[421,426,276],{"class":427},"sBMFI",[421,429,431],{"class":430},"sTEyZ","({\n",[421,433,435,439,442,445],{"class":423,"line":434},2,[421,436,438],{"class":437},"spNyl","  required",[421,440,441],{"class":427}," AppleOAuthConfig",[421,443,444],{"class":430}," config",[421,446,448],{"class":447},"sMK4o",",\n",[421,450,452,455,458,461],{"class":423,"line":451},3,[421,453,454],{"class":427},"  Dio",[421,456,457],{"class":447},"?",[421,459,460],{"class":430}," dio",[421,462,448],{"class":447},[421,464,466],{"class":423,"line":465},4,[421,467,468],{"class":430},"})\n",[301,470,471,481],{},[304,472,473],{},[307,474,475,478],{},[310,476,477],{},"Parameter",[310,479,480],{},"Description",[317,482,483,496],{},[307,484,485,490],{},[322,486,487],{},[274,488,489],{},"config",[322,491,492,495],{},[274,493,494],{},"AppleOAuthConfig"," — credentials and redirect URI",[307,497,498,503],{},[322,499,500],{},[274,501,502],{},"dio",[322,504,505],{},"Optional Dio instance for testing or shared interceptors",[271,507,508,509,512],{},"The provider ID is ",[274,510,511],{},"'apple'",".",[293,514],{},[296,516,494],{"id":517},"appleoauthconfig",[412,519,521],{"className":414,"code":520,"language":416,"meta":417,"style":417},"AppleOAuthConfig({\n  required String clientId,\n  required String teamId,\n  required String keyId,\n  required String privateKeyPem,\n  required String redirectUri,\n  List\u003CString> scopes = const ['name', 'email'],\n  Duration clientSecretValidity = const Duration(days: 180),\n  Duration timeout = const Duration(minutes: 5),\n})\n",[274,522,523,529,541,552,563,575,587,626,657,683],{"__ignoreMap":417},[421,524,525,527],{"class":423,"line":424},[421,526,494],{"class":427},[421,528,431],{"class":430},[421,530,531,533,536,539],{"class":423,"line":434},[421,532,438],{"class":437},[421,534,535],{"class":427}," String",[421,537,538],{"class":430}," clientId",[421,540,448],{"class":447},[421,542,543,545,547,550],{"class":423,"line":451},[421,544,438],{"class":437},[421,546,535],{"class":427},[421,548,549],{"class":430}," teamId",[421,551,448],{"class":447},[421,553,554,556,558,561],{"class":423,"line":465},[421,555,438],{"class":437},[421,557,535],{"class":427},[421,559,560],{"class":430}," keyId",[421,562,448],{"class":447},[421,564,566,568,570,573],{"class":423,"line":565},5,[421,567,438],{"class":437},[421,569,535],{"class":427},[421,571,572],{"class":430}," privateKeyPem",[421,574,448],{"class":447},[421,576,578,580,582,585],{"class":423,"line":577},6,[421,579,438],{"class":437},[421,581,535],{"class":427},[421,583,584],{"class":430}," redirectUri",[421,586,448],{"class":447},[421,588,590,593,596,599,602,605,608,611,615,618,621,624],{"class":423,"line":589},7,[421,591,592],{"class":427},"  List",[421,594,595],{"class":430},"\u003C",[421,597,598],{"class":427},"String",[421,600,601],{"class":430},"> scopes ",[421,603,604],{"class":447},"=",[421,606,607],{"class":437}," const",[421,609,610],{"class":430}," [",[421,612,614],{"class":613},"sfazB","'name'",[421,616,617],{"class":447},",",[421,619,620],{"class":613}," 'email'",[421,622,623],{"class":430},"]",[421,625,448],{"class":447},[421,627,629,632,635,637,639,642,645,648,652,655],{"class":423,"line":628},8,[421,630,631],{"class":427},"  Duration",[421,633,634],{"class":430}," clientSecretValidity ",[421,636,604],{"class":447},[421,638,607],{"class":437},[421,640,641],{"class":427}," Duration",[421,643,644],{"class":430},"(days",[421,646,647],{"class":447},":",[421,649,651],{"class":650},"sbssI"," 180",[421,653,654],{"class":430},")",[421,656,448],{"class":447},[421,658,660,662,665,667,669,671,674,676,679,681],{"class":423,"line":659},9,[421,661,631],{"class":427},[421,663,664],{"class":430}," timeout ",[421,666,604],{"class":447},[421,668,607],{"class":437},[421,670,641],{"class":427},[421,672,673],{"class":430},"(minutes",[421,675,647],{"class":447},[421,677,678],{"class":650}," 5",[421,680,654],{"class":430},[421,682,448],{"class":447},[421,684,686],{"class":423,"line":685},10,[421,687,468],{"class":430},[301,689,690,702],{},[304,691,692],{},[307,693,694,697,700],{},[310,695,696],{},"Field",[310,698,699],{},"Default",[310,701,480],{},[317,703,704,720,732,744,759,771,791,806],{},[307,705,706,711,714],{},[322,707,708],{},[274,709,710],{},"clientId",[322,712,713],{},"required",[322,715,716,717,654],{},"Services ID from the Apple Developer Portal (e.g. ",[274,718,719],{},"com.example.app.web",[307,721,722,727,729],{},[322,723,724],{},[274,725,726],{},"teamId",[322,728,713],{},[322,730,731],{},"10-character Team ID from the top-right of the Developer Portal",[307,733,734,739,741],{},[322,735,736],{},[274,737,738],{},"keyId",[322,740,713],{},[322,742,743],{},"Key ID of the Sign in with Apple key",[307,745,746,751,753],{},[322,747,748],{},[274,749,750],{},"privateKeyPem",[322,752,713],{},[322,754,755,756,758],{},"Full contents of the ",[274,757,330],{}," file including header/footer",[307,760,761,766,768],{},[322,762,763],{},[274,764,765],{},"redirectUri",[322,767,713],{},[322,769,770],{},"HTTPS URI registered in the Developer Portal",[307,772,773,778,783],{},[322,774,775],{},[274,776,777],{},"scopes",[322,779,780],{},[274,781,782],{},"['name', 'email']",[322,784,785,786,788,789],{},"Apple supports only ",[274,787,365],{}," and ",[274,790,346],{},[307,792,793,798,803],{},[322,794,795],{},[274,796,797],{},"clientSecretValidity",[322,799,800],{},[274,801,802],{},"180 days",[322,804,805],{},"Lifetime of the generated ES256 JWT (Apple max: 180 days)",[307,807,808,813,818],{},[322,809,810],{},[274,811,812],{},"timeout",[322,814,815],{},[274,816,817],{},"5 min",[322,819,820,821],{},"Max wait before throwing ",[274,822,823],{},"AuthenticationCancelledException",[293,825],{},[296,827,829],{"id":828},"setup","Setup",[831,832,834],"h3",{"id":833},"_1-configure-in-apple-developer-portal","1. Configure in Apple Developer Portal",[271,836,837,840,841,843],{},[285,838,839],{},"Services ID"," (used as ",[274,842,710],{},"):",[845,846,847,861,871],"ol",{},[848,849,850,851,858,859,512],"li",{},"In ",[852,853,857],"a",{"href":854,"rel":855},"https://developer.apple.com/account/resources/identifiers/list/serviceId",[856],"nofollow","Identifiers"," create a ",[285,860,839],{},[848,862,863,864,867,868,512],{},"Enable ",[285,865,866],{},"Sign in with Apple"," and click ",[285,869,870],{},"Configure",[848,872,873,874,876,877,880,881,884],{},"Add your ",[274,875,765],{}," domain under ",[285,878,879],{},"Web Domain"," and the full URI under ",[285,882,883],{},"Return URLs",". Apple requires HTTPS — localhost is not permitted.",[271,886,887,890,891,788,893,843],{},[285,888,889],{},"Key"," (used for ",[274,892,738],{},[274,894,750],{},[845,896,897,905,910,919],{},[848,898,850,899,904],{},[852,900,903],{"href":901,"rel":902},"https://developer.apple.com/account/resources/authkeys/list",[856],"Keys"," create a new key.",[848,906,863,907,909],{},[285,908,866],{}," and configure it for your App ID.",[848,911,912,913,915,916,512],{},"Download the ",[274,914,330],{}," file — ",[285,917,918],{},"you can only download it once",[848,920,921,922,925],{},"Note the ",[285,923,924],{},"Key ID"," shown next to the key.",[831,927,929],{"id":928},"_2-add-the-provider","2. Add the provider",[412,931,934],{"className":414,"code":932,"filename":933,"language":416,"meta":417,"style":417},"import 'package:app_links/app_links.dart';\nimport 'package:authyra_flutter/authyra_flutter.dart';\n\nFuture\u003Cvoid> main() async {\n  WidgetsFlutterBinding.ensureInitialized();\n\n  final appleProvider = AppleProvider(\n    config: AppleOAuthConfig(\n      clientId:      'com.example.app.service',\n      teamId:        'AB12CD34EF',\n      keyId:         'XYZXYZXYZX',\n      privateKeyPem: const String.fromEnvironment('APPLE_PRIVATE_KEY'),\n      redirectUri:   'https://api.example.com/auth/apple/callback',\n    ),\n  );\n\n  // Apple redirects to an HTTPS URI — use Universal Links or your backend\n  // to relay the callback back to the app via a custom scheme.\n  OAuth2CallbackHandler.registerProvider('https', appleProvider);\n  AppLinks().uriLinkStream.listen(OAuth2CallbackHandler.handleCallback);\n\n  await Authyra.initialize(\n    client: AuthyraClient(\n      providers: [appleProvider],\n      storage: SecureAuthStorage(),\n      config: const AuthConfig(autoRefresh: true),\n    ),\n  );\n\n  runApp(const MyApp());\n}\n","lib/main.dart",[274,935,936,947,956,962,989,1004,1008,1024,1035,1047,1059,1072,1099,1112,1120,1128,1133,1140,1146,1169,1199,1204,1220,1233,1246,1261,1286,1293,1300,1305,1324],{"__ignoreMap":417},[421,937,938,941,944],{"class":423,"line":424},[421,939,940],{"class":650},"import",[421,942,943],{"class":613}," 'package:app_links/app_links.dart'",[421,945,946],{"class":447},";\n",[421,948,949,951,954],{"class":423,"line":434},[421,950,940],{"class":650},[421,952,953],{"class":613}," 'package:authyra_flutter/authyra_flutter.dart'",[421,955,946],{"class":447},[421,957,958],{"class":423,"line":451},[421,959,961],{"emptyLinePlaceholder":960},true,"\n",[421,963,964,967,969,972,975,979,982,986],{"class":423,"line":465},[421,965,966],{"class":427},"Future",[421,968,595],{"class":430},[421,970,971],{"class":437},"void",[421,973,974],{"class":430},"> ",[421,976,978],{"class":977},"s2Zo4","main",[421,980,981],{"class":430},"() ",[421,983,985],{"class":984},"s7zQu","async",[421,987,988],{"class":430}," {\n",[421,990,991,994,996,999,1002],{"class":423,"line":565},[421,992,993],{"class":427},"  WidgetsFlutterBinding",[421,995,512],{"class":447},[421,997,998],{"class":977},"ensureInitialized",[421,1000,1001],{"class":430},"()",[421,1003,946],{"class":447},[421,1005,1006],{"class":423,"line":577},[421,1007,961],{"emptyLinePlaceholder":960},[421,1009,1010,1013,1016,1018,1021],{"class":423,"line":589},[421,1011,1012],{"class":437},"  final",[421,1014,1015],{"class":430}," appleProvider ",[421,1017,604],{"class":447},[421,1019,1020],{"class":427}," AppleProvider",[421,1022,1023],{"class":430},"(\n",[421,1025,1026,1029,1031,1033],{"class":423,"line":628},[421,1027,1028],{"class":430},"    config",[421,1030,647],{"class":447},[421,1032,441],{"class":427},[421,1034,1023],{"class":430},[421,1036,1037,1040,1042,1045],{"class":423,"line":659},[421,1038,1039],{"class":430},"      clientId",[421,1041,647],{"class":447},[421,1043,1044],{"class":613},"      'com.example.app.service'",[421,1046,448],{"class":447},[421,1048,1049,1052,1054,1057],{"class":423,"line":685},[421,1050,1051],{"class":430},"      teamId",[421,1053,647],{"class":447},[421,1055,1056],{"class":613},"        'AB12CD34EF'",[421,1058,448],{"class":447},[421,1060,1062,1065,1067,1070],{"class":423,"line":1061},11,[421,1063,1064],{"class":430},"      keyId",[421,1066,647],{"class":447},[421,1068,1069],{"class":613},"         'XYZXYZXYZX'",[421,1071,448],{"class":447},[421,1073,1075,1078,1080,1082,1084,1086,1089,1092,1095,1097],{"class":423,"line":1074},12,[421,1076,1077],{"class":430},"      privateKeyPem",[421,1079,647],{"class":447},[421,1081,607],{"class":437},[421,1083,535],{"class":427},[421,1085,512],{"class":447},[421,1087,1088],{"class":977},"fromEnvironment",[421,1090,1091],{"class":430},"(",[421,1093,1094],{"class":613},"'APPLE_PRIVATE_KEY'",[421,1096,654],{"class":430},[421,1098,448],{"class":447},[421,1100,1102,1105,1107,1110],{"class":423,"line":1101},13,[421,1103,1104],{"class":430},"      redirectUri",[421,1106,647],{"class":447},[421,1108,1109],{"class":613},"   'https://api.example.com/auth/apple/callback'",[421,1111,448],{"class":447},[421,1113,1115,1118],{"class":423,"line":1114},14,[421,1116,1117],{"class":430},"    )",[421,1119,448],{"class":447},[421,1121,1123,1126],{"class":423,"line":1122},15,[421,1124,1125],{"class":430},"  )",[421,1127,946],{"class":447},[421,1129,1131],{"class":423,"line":1130},16,[421,1132,961],{"emptyLinePlaceholder":960},[421,1134,1136],{"class":423,"line":1135},17,[421,1137,1139],{"class":1138},"sHwdD","  // Apple redirects to an HTTPS URI — use Universal Links or your backend\n",[421,1141,1143],{"class":423,"line":1142},18,[421,1144,1145],{"class":1138},"  // to relay the callback back to the app via a custom scheme.\n",[421,1147,1149,1152,1154,1157,1159,1162,1164,1167],{"class":423,"line":1148},19,[421,1150,1151],{"class":427},"  OAuth2CallbackHandler",[421,1153,512],{"class":447},[421,1155,1156],{"class":977},"registerProvider",[421,1158,1091],{"class":430},[421,1160,1161],{"class":613},"'https'",[421,1163,617],{"class":447},[421,1165,1166],{"class":430}," appleProvider)",[421,1168,946],{"class":447},[421,1170,1172,1175,1177,1179,1182,1184,1187,1189,1192,1194,1197],{"class":423,"line":1171},20,[421,1173,1174],{"class":427},"  AppLinks",[421,1176,1001],{"class":430},[421,1178,512],{"class":447},[421,1180,1181],{"class":430},"uriLinkStream",[421,1183,512],{"class":447},[421,1185,1186],{"class":977},"listen",[421,1188,1091],{"class":430},[421,1190,1191],{"class":427},"OAuth2CallbackHandler",[421,1193,512],{"class":447},[421,1195,1196],{"class":430},"handleCallback)",[421,1198,946],{"class":447},[421,1200,1202],{"class":423,"line":1201},21,[421,1203,961],{"emptyLinePlaceholder":960},[421,1205,1207,1210,1213,1215,1218],{"class":423,"line":1206},22,[421,1208,1209],{"class":984},"  await",[421,1211,1212],{"class":427}," Authyra",[421,1214,512],{"class":447},[421,1216,1217],{"class":977},"initialize",[421,1219,1023],{"class":430},[421,1221,1223,1226,1228,1231],{"class":423,"line":1222},23,[421,1224,1225],{"class":430},"    client",[421,1227,647],{"class":447},[421,1229,1230],{"class":427}," AuthyraClient",[421,1232,1023],{"class":430},[421,1234,1236,1239,1241,1244],{"class":423,"line":1235},24,[421,1237,1238],{"class":430},"      providers",[421,1240,647],{"class":447},[421,1242,1243],{"class":430}," [appleProvider]",[421,1245,448],{"class":447},[421,1247,1249,1252,1254,1257,1259],{"class":423,"line":1248},25,[421,1250,1251],{"class":430},"      storage",[421,1253,647],{"class":447},[421,1255,1256],{"class":427}," SecureAuthStorage",[421,1258,1001],{"class":430},[421,1260,448],{"class":447},[421,1262,1264,1267,1269,1271,1274,1277,1279,1282,1284],{"class":423,"line":1263},26,[421,1265,1266],{"class":430},"      config",[421,1268,647],{"class":447},[421,1270,607],{"class":437},[421,1272,1273],{"class":427}," AuthConfig",[421,1275,1276],{"class":430},"(autoRefresh",[421,1278,647],{"class":447},[421,1280,1281],{"class":447}," true",[421,1283,654],{"class":430},[421,1285,448],{"class":447},[421,1287,1289,1291],{"class":423,"line":1288},27,[421,1290,1117],{"class":430},[421,1292,448],{"class":447},[421,1294,1296,1298],{"class":423,"line":1295},28,[421,1297,1125],{"class":430},[421,1299,946],{"class":447},[421,1301,1303],{"class":423,"line":1302},29,[421,1304,961],{"emptyLinePlaceholder":960},[421,1306,1308,1311,1313,1316,1319,1322],{"class":423,"line":1307},30,[421,1309,1310],{"class":977},"  runApp",[421,1312,1091],{"class":430},[421,1314,1315],{"class":437},"const",[421,1317,1318],{"class":427}," MyApp",[421,1320,1321],{"class":430},"())",[421,1323,946],{"class":447},[421,1325,1327],{"class":423,"line":1326},31,[421,1328,1329],{"class":430},"}\n",[393,1331,1333,1334,1336],{"icon":1332},"i-lucide-shield","Never hardcode ",[274,1335,750],{}," in source control. Load it from an environment variable, a secrets manager, or an encrypted asset file excluded from version control.",[831,1338,1340],{"id":1339},"_3-deep-link-relay","3. Deep-link relay",[271,1342,1343,1344,1346],{},"Apple requires an HTTPS ",[274,1345,765],{},". For native apps, set up a server endpoint that:",[845,1348,1349,1358],{},[848,1350,1351,1352,788,1354,1357],{},"Receives the ",[274,1353,274],{},[274,1355,1356],{},"state"," from Apple.",[848,1359,1360,1361,512],{},"Relays them to the app via a custom URI scheme: ",[274,1362,1363],{},"myapp://auth/apple/callback?code=…&state=…",[271,1365,1366,1367,512],{},"Then register the custom scheme in your platform manifests and pass it as the scheme to ",[274,1368,1191],{},[293,1370],{},[296,1372,1374],{"id":1373},"sign-in","Sign in",[412,1376,1378],{"className":414,"code":1377,"language":416,"meta":417,"style":417},"try {\n  final user = await Authyra.instance.signIn('apple');\n  print('Hello, ${user.name ?? user.email ?? 'there'}!');\n} on AuthenticationCancelledException {\n  // User tapped \"Cancel\" on the Apple sign-in sheet\n} on AuthenticationFailedException catch (e) {\n  print('Apple sign-in failed: $e');\n}\n",[274,1379,1380,1387,1419,1463,1476,1481,1496,1518],{"__ignoreMap":417},[421,1381,1382,1385],{"class":423,"line":424},[421,1383,1384],{"class":984},"try",[421,1386,988],{"class":430},[421,1388,1389,1391,1394,1396,1399,1401,1403,1406,1408,1411,1413,1415,1417],{"class":423,"line":434},[421,1390,1012],{"class":437},[421,1392,1393],{"class":430}," user ",[421,1395,604],{"class":447},[421,1397,1398],{"class":984}," await",[421,1400,1212],{"class":427},[421,1402,512],{"class":447},[421,1404,1405],{"class":430},"instance",[421,1407,512],{"class":447},[421,1409,1410],{"class":977},"signIn",[421,1412,1091],{"class":430},[421,1414,511],{"class":613},[421,1416,654],{"class":430},[421,1418,946],{"class":447},[421,1420,1421,1424,1426,1429,1432,1435,1437,1439,1442,1444,1446,1448,1450,1453,1456,1459,1461],{"class":423,"line":451},[421,1422,1423],{"class":977},"  print",[421,1425,1091],{"class":430},[421,1427,1428],{"class":613},"'Hello, ",[421,1430,1431],{"class":430},"${",[421,1433,368],{"class":1434},"sHdIc",[421,1436,512],{"class":430},[421,1438,365],{"class":1434},[421,1440,1441],{"class":430}," ?? ",[421,1443,368],{"class":1434},[421,1445,512],{"class":430},[421,1447,346],{"class":1434},[421,1449,1441],{"class":430},[421,1451,1452],{"class":613},"'there'",[421,1454,1455],{"class":430},"}",[421,1457,1458],{"class":613},"!'",[421,1460,654],{"class":430},[421,1462,946],{"class":447},[421,1464,1465,1468,1471,1474],{"class":423,"line":465},[421,1466,1467],{"class":430},"} ",[421,1469,1470],{"class":984},"on",[421,1472,1473],{"class":427}," AuthenticationCancelledException",[421,1475,988],{"class":430},[421,1477,1478],{"class":423,"line":565},[421,1479,1480],{"class":1138},"  // User tapped \"Cancel\" on the Apple sign-in sheet\n",[421,1482,1483,1485,1487,1490,1493],{"class":423,"line":577},[421,1484,1467],{"class":430},[421,1486,1470],{"class":984},[421,1488,1489],{"class":427}," AuthenticationFailedException",[421,1491,1492],{"class":984}," catch",[421,1494,1495],{"class":430}," (e) {\n",[421,1497,1498,1500,1502,1505,1508,1511,1514,1516],{"class":423,"line":589},[421,1499,1423],{"class":977},[421,1501,1091],{"class":430},[421,1503,1504],{"class":613},"'Apple sign-in failed: ",[421,1506,1507],{"class":430},"$",[421,1509,1510],{"class":1434},"e",[421,1512,1513],{"class":613},"'",[421,1515,654],{"class":430},[421,1517,946],{"class":447},[421,1519,1520],{"class":423,"line":628},[421,1521,1329],{"class":430},[293,1523],{},[296,1525,1527],{"id":1526},"user-fields","User fields",[301,1529,1530,1545],{},[304,1531,1532],{},[307,1533,1534,1539,1542],{},[310,1535,1536,1538],{},[274,1537,372],{}," field",[310,1540,1541],{},"Source",[310,1543,1544],{},"Notes",[317,1546,1547,1564,1579,1596,1609,1622],{},[307,1548,1549,1554,1561],{},[322,1550,1551],{},[274,1552,1553],{},"id",[322,1555,1556,1558,1559],{},[274,1557,280],{}," → ",[274,1560,342],{},[322,1562,1563],{},"Stable Apple User ID",[307,1565,1566,1570,1576],{},[322,1567,1568],{},[274,1569,346],{},[322,1571,1572,1558,1574],{},[274,1573,280],{},[274,1575,346],{},[322,1577,1578],{},"May be an Apple-relayed private address",[307,1580,1581,1585,1590],{},[322,1582,1583],{},[274,1584,365],{},[322,1586,1587,1589],{},[274,1588,368],{}," callback param",[322,1591,1592,1595],{},[285,1593,1594],{},"First sign-in only"," — persist immediately",[307,1597,1598,1603,1607],{},[322,1599,1600],{},[274,1601,1602],{},"metadata['email_verified']",[322,1604,1605],{},[274,1606,280],{},[322,1608],{},[307,1610,1611,1616,1620],{},[322,1612,1613],{},[274,1614,1615],{},"metadata['given_name']",[322,1617,1618,1589],{},[274,1619,368],{},[322,1621,1594],{},[307,1623,1624,1629,1633],{},[322,1625,1626],{},[274,1627,1628],{},"metadata['family_name']",[322,1630,1631,1589],{},[274,1632,368],{},[322,1634,1594],{},[293,1636],{},[296,1638,1640],{"id":1639},"token-refresh","Token refresh",[271,1642,1643,1644,1646,1647,1649,1650,1652],{},"Apple refresh tokens are valid for up to 6 months and are not rotated on use. ",[274,1645,276],{}," sets ",[274,1648,390],{},". When ",[274,1651,199],{}," detects that the access token is approaching expiry, it silently exchanges the refresh token:",[412,1654,1656],{"className":414,"code":1655,"language":416,"meta":417,"style":417},"await Authyra.instance.refreshSession();\n",[274,1657,1658],{"__ignoreMap":417},[421,1659,1660,1663,1665,1667,1669,1671,1674,1676],{"class":423,"line":424},[421,1661,1662],{"class":984},"await",[421,1664,1212],{"class":427},[421,1666,512],{"class":447},[421,1668,1405],{"class":430},[421,1670,512],{"class":447},[421,1672,1673],{"class":977},"refreshSession",[421,1675,1001],{"class":430},[421,1677,946],{"class":447},[293,1679],{},[296,1681,1683],{"id":1682},"persisting-the-users-name","Persisting the user's name",[271,1685,1686,1687,1689,1690,1692],{},"Apple sends ",[274,1688,365],{}," data only on the first sign-in. After a successful sign-in, immediately persist ",[274,1691,403],{}," alongside the user record in your backend. On subsequent sign-ins, restore the name from your backend rather than relying on Authyra's session.",[412,1694,1696],{"className":414,"code":1695,"language":416,"meta":417,"style":417},"final user = await Authyra.instance.signIn('apple');\n\nif (user.name != null) {\n  // First sign-in — save name to your backend now\n  await myApi.updateUser(id: user.id, name: user.name!);\n}\n",[274,1697,1698,1727,1731,1753,1758,1802],{"__ignoreMap":417},[421,1699,1700,1703,1705,1707,1709,1711,1713,1715,1717,1719,1721,1723,1725],{"class":423,"line":424},[421,1701,1702],{"class":437},"final",[421,1704,1393],{"class":430},[421,1706,604],{"class":447},[421,1708,1398],{"class":984},[421,1710,1212],{"class":427},[421,1712,512],{"class":447},[421,1714,1405],{"class":430},[421,1716,512],{"class":447},[421,1718,1410],{"class":977},[421,1720,1091],{"class":430},[421,1722,511],{"class":613},[421,1724,654],{"class":430},[421,1726,946],{"class":447},[421,1728,1729],{"class":423,"line":434},[421,1730,961],{"emptyLinePlaceholder":960},[421,1732,1733,1736,1739,1741,1744,1747,1750],{"class":423,"line":451},[421,1734,1735],{"class":984},"if",[421,1737,1738],{"class":430}," (user",[421,1740,512],{"class":447},[421,1742,1743],{"class":430},"name ",[421,1745,1746],{"class":447},"!=",[421,1748,1749],{"class":447}," null",[421,1751,1752],{"class":430},") {\n",[421,1754,1755],{"class":423,"line":465},[421,1756,1757],{"class":1138},"  // First sign-in — save name to your backend now\n",[421,1759,1760,1762,1765,1767,1770,1773,1775,1778,1780,1782,1784,1787,1789,1791,1793,1795,1798,1800],{"class":423,"line":565},[421,1761,1209],{"class":984},[421,1763,1764],{"class":430}," myApi",[421,1766,512],{"class":447},[421,1768,1769],{"class":977},"updateUser",[421,1771,1772],{"class":430},"(id",[421,1774,647],{"class":447},[421,1776,1777],{"class":430}," user",[421,1779,512],{"class":447},[421,1781,1553],{"class":430},[421,1783,617],{"class":447},[421,1785,1786],{"class":430}," name",[421,1788,647],{"class":447},[421,1790,1777],{"class":430},[421,1792,512],{"class":447},[421,1794,365],{"class":430},[421,1796,1797],{"class":447},"!",[421,1799,654],{"class":430},[421,1801,946],{"class":447},[421,1803,1804],{"class":423,"line":577},[421,1805,1329],{"class":430},[293,1807],{},[296,1809,254],{"id":1810},"troubleshooting",[271,1812,1813],{},[285,1814,1815,1818],{},[274,1816,1817],{},"invalid_client"," from Apple",[271,1820,1821],{},"The ES256 JWT was rejected. Check:",[1823,1824,1825,1830,1835,1840],"ul",{},[848,1826,1827,1829],{},[274,1828,726],{}," is your 10-character team identifier (not the App ID prefix).",[848,1831,1832,1834],{},[274,1833,738],{}," matches the key shown in Apple Developer → Keys.",[848,1836,1837,1839],{},[274,1838,750],{}," includes the full header and footer lines.",[848,1841,1842,1844],{},[274,1843,710],{}," is the exact Services ID registered in Apple Developer.",[271,1846,1847],{},[285,1848,1849],{},"Name is null after first sign-in",[271,1851,1852,1853,1855,1856,1858,1859,1862,1863,512],{},"The ",[274,1854,368],{}," parameter Apple sends in the callback URL was not captured. This happens if the callback deep-link was not delivered to ",[274,1857,1191],{}," before the token exchange completed. Ensure ",[274,1860,1861],{},"AppLinks().uriLinkStream.listen(OAuth2CallbackHandler.handleCallback)"," is registered before ",[274,1864,1865],{},"Authyra.initialize",[271,1867,1868],{},[285,1869,1870,1872],{},[274,1871,765],{}," not accepted by Apple",[271,1874,1875,1876,512],{},"Apple only accepts HTTPS URIs. The domain must be verified in your Services ID configuration under ",[285,1877,879],{},[293,1879],{},[296,1881,1883],{"id":1882},"see-also","See also",[1823,1885,1886,1892,1898],{},[848,1887,1888,1891],{},[852,1889,1890],{"href":99},"OAuth2Provider →"," — base class",[848,1893,1894,1897],{},[852,1895,1896],{"href":115},"ProxyOAuthProvider →"," — backend relay pattern (avoids HTTPS URI requirement)",[848,1899,1900,1903],{},[852,1901,1902],{"href":171},"Flutter Setup →"," — deep-link wiring",[1905,1906,1907],"style",{},"html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html pre.shiki code .sHdIc, html code.shiki .sHdIc{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic}",{"title":417,"searchDepth":434,"depth":434,"links":1909},[1910,1911,1912,1913,1918,1919,1920,1921,1922,1923],{"id":298,"depth":434,"text":299},{"id":409,"depth":434,"text":410},{"id":517,"depth":434,"text":494},{"id":828,"depth":434,"text":829,"children":1914},[1915,1916,1917],{"id":833,"depth":451,"text":834},{"id":928,"depth":451,"text":929},{"id":1339,"depth":451,"text":1340},{"id":1373,"depth":434,"text":1374},{"id":1526,"depth":434,"text":1527},{"id":1639,"depth":434,"text":1640},{"id":1682,"depth":434,"text":1683},{"id":1810,"depth":434,"text":254},{"id":1882,"depth":434,"text":1883},"Sign in with Apple — OAuth 2.0 with PKCE, dynamic ES256 client secret, and id_token user extraction.","md",null,{},{"title":1929,"description":1930},"Apple Provider | Authyra","Add Sign in with Apple to your Flutter app with AppleProvider — ES256 JWT client secret, id_token profile extraction, and first-sign-in name capture.","yX2cF1j13R51wPOu1mj8lJbu6a2gL1WsB2giMEo1XQk",[1933,1935],{"title":106,"path":107,"stem":108,"description":1934,"children":-1},"Prebuilt GitHub OAuth provider — Authorization Code flow with client secret.",{"title":114,"path":115,"stem":116,"description":1936,"children":-1},"Backend-delegated OAuth — the client secret never leaves your server.",1782700510630]