{"id":"15d9ee11-2f18-4898-84da-301a8d181042","shortId":"5NFt8M","kind":"skill","title":"authentication","tagline":"Implement iOS authentication patterns including Sign in with Apple (ASAuthorizationAppleIDProvider, ASAuthorizationController, ASAuthorizationAppleIDCredential), credential state checking, identity token validation, ASWebAuthenticationSession for OAuth and third-party auth flows,","description":"# Authentication\n\nImplement authentication flows on iOS using the AuthenticationServices\nframework, including Sign in with Apple, OAuth/third-party web auth,\nPassword AutoFill, and biometric authentication.\n\n## Contents\n\n- [Sign in with Apple](#sign-in-with-apple)\n- [Credential Handling](#credential-handling)\n- [Credential State Checking](#credential-state-checking)\n- [Token Validation](#token-validation)\n- [Existing Account Setup Flows](#existing-account-setup-flows)\n- [ASWebAuthenticationSession (OAuth)](#aswebauthenticationsession-oauth)\n- [Password AutoFill Credentials](#password-autofill-credentials)\n- [Biometric Authentication](#biometric-authentication)\n- [SwiftUI SignInWithAppleButton](#swiftui-signinwithapplebutton)\n- [Common Mistakes](#common-mistakes)\n- [Review Checklist](#review-checklist)\n- [References](#references)\n\n## Sign in with Apple\n\nAdd the \"Sign in with Apple\" capability in Xcode before using these APIs.\n\n### UIKit: ASAuthorizationController Setup\n\n```swift\nimport AuthenticationServices\n\nfinal class LoginViewController: UIViewController {\n    func startSignInWithApple() {\n        let provider = ASAuthorizationAppleIDProvider()\n        let request = provider.createRequest()\n        request.requestedScopes = [.fullName, .email]\n\n        let controller = ASAuthorizationController(authorizationRequests: [request])\n        controller.delegate = self\n        controller.presentationContextProvider = self\n        controller.performRequests()\n    }\n}\n\nextension LoginViewController: ASAuthorizationControllerPresentationContextProviding {\n    func presentationAnchor(for controller: ASAuthorizationController) -> ASPresentationAnchor {\n        view.window!\n    }\n}\n```\n\n### Delegate: Handling Success and Failure\n\n```swift\nextension LoginViewController: ASAuthorizationControllerDelegate {\n    func authorizationController(\n        controller: ASAuthorizationController,\n        didCompleteWithAuthorization authorization: ASAuthorization\n    ) {\n        guard let credential = authorization.credential\n            as? ASAuthorizationAppleIDCredential else { return }\n\n        let userID = credential.user  // Stable, unique, per-team identifier\n        let email = credential.email  // nil after first authorization\n        let fullName = credential.fullName  // nil after first authorization\n        let identityToken = credential.identityToken  // JWT for server validation\n        let authCode = credential.authorizationCode  // Short-lived code for server exchange\n\n        // Save userID to Keychain for credential state checks\n        // See references/keychain-biometric.md for Keychain patterns\n        saveUserID(userID)\n\n        // Send identityToken and authCode to your server\n        authenticateWithServer(identityToken: identityToken, authCode: authCode)\n    }\n\n    func authorizationController(\n        controller: ASAuthorizationController,\n        didCompleteWithError error: any Error\n    ) {\n        let authError = error as? ASAuthorizationError\n        switch authError?.code {\n        case .canceled:\n            break  // User dismissed\n        case .failed:\n            showError(\"Authorization failed\")\n        case .invalidResponse:\n            showError(\"Invalid response\")\n        case .notHandled:\n            showError(\"Not handled\")\n        case .notInteractive:\n            break  // Non-interactive request failed -- expected for silent checks\n        default:\n            showError(\"Unknown error\")\n        }\n    }\n}\n```\n\n## Credential Handling\n\n`ASAuthorizationAppleIDCredential` properties and their behavior:\n\n| Property | Type | First Auth | Subsequent Auth |\n|---|---|---|---|\n| `user` | `String` | Always | Always |\n| `email` | `String?` | Provided if requested | `nil` |\n| `fullName` | `PersonNameComponents?` | Provided if requested | `nil` |\n| `identityToken` | `Data?` | JWT (Base64) | JWT (Base64) |\n| `authorizationCode` | `Data?` | Short-lived code | Short-lived code |\n| `realUserStatus` | `ASUserDetectionStatus` | `.likelyReal` / `.unknown` | `.unknown` |\n\n**Critical:** `email` and `fullName` are provided ONLY on the first\nauthorization. Cache them immediately during the initial sign-up flow. If the\nuser later deletes and re-adds the app, these values will not be returned.\n\n```swift\nfunc handleCredential(_ credential: ASAuthorizationAppleIDCredential) {\n    // Always persist the user identifier\n    let userID = credential.user\n\n    // Cache name and email IMMEDIATELY -- only available on first auth\n    if let fullName = credential.fullName {\n        let name = PersonNameComponentsFormatter().string(from: fullName)\n        UserProfile.saveName(name)  // Persist to your backend\n    }\n    if let email = credential.email {\n        UserProfile.saveEmail(email)  // Persist to your backend\n    }\n}\n```\n\n## Credential State Checking\n\nCheck credential state on every app launch. The user may revoke access at\nany time via Settings > Apple Account > Sign-In & Security.\n\n```swift\nfunc checkCredentialState() async {\n    let provider = ASAuthorizationAppleIDProvider()\n    guard let userID = loadSavedUserID() else {\n        showLoginScreen()\n        return\n    }\n\n    do {\n        let state = try await provider.credentialState(forUserID: userID)\n        switch state {\n        case .authorized:\n            proceedToMainApp()\n        case .revoked:\n            // User revoked -- sign out and clear local data\n            signOut()\n            showLoginScreen()\n        case .notFound:\n            showLoginScreen()\n        case .transferred:\n            // App transferred to new team -- migrate user identifier\n            migrateUser()\n        @unknown default:\n            showLoginScreen()\n        }\n    } catch {\n        // Network error -- allow offline access or retry\n        proceedToMainApp()\n    }\n}\n```\n\n### Credential Revocation Notification\n\n```swift\nNotificationCenter.default.addObserver(\n    forName: ASAuthorizationAppleIDProvider.credentialRevokedNotification,\n    object: nil,\n    queue: .main\n) { _ in\n    // Sign out immediately\n    AuthManager.shared.signOut()\n}\n```\n\n## Token Validation\n\nThe `identityToken` is a JWT. Send it to your server for validation --\nnever trust it client-side alone.\n\n```swift\nfunc sendTokenToServer(credential: ASAuthorizationAppleIDCredential) async throws {\n    guard let tokenData = credential.identityToken,\n          let token = String(data: tokenData, encoding: .utf8),\n          let authCodeData = credential.authorizationCode,\n          let authCode = String(data: authCodeData, encoding: .utf8) else {\n        throw AuthError.missingToken\n    }\n\n    var request = URLRequest(url: URL(string: \"https://api.example.com/auth/apple\")!)\n    request.httpMethod = \"POST\"\n    request.setValue(\"application/json\", forHTTPHeaderField: \"Content-Type\")\n    request.httpBody = try JSONEncoder().encode(\n        [\"identityToken\": token, \"authorizationCode\": authCode]\n    )\n\n    let (data, response) = try await URLSession.shared.data(for: request)\n    guard (response as? HTTPURLResponse)?.statusCode == 200 else {\n        throw AuthError.serverValidationFailed\n    }\n    let session = try JSONDecoder().decode(SessionResponse.self, from: data)\n    // Store session token in Keychain -- see references/keychain-biometric.md\n    try KeychainHelper.save(session.accessToken, forKey: \"accessToken\")\n}\n```\n\nServer-side, validate the JWT against Apple's public keys at\n`https://appleid.apple.com/auth/keys` (JWKS). Verify: `iss` is\n`https://appleid.apple.com`, `aud` matches your bundle ID, `exp` not passed.\n\n## Existing Account Setup Flows\n\nOn launch, silently check for existing Sign in with Apple and password\ncredentials before showing a login screen:\n\n```swift\nfunc performExistingAccountSetupFlows() {\n    let appleIDRequest = ASAuthorizationAppleIDProvider().createRequest()\n    let passwordRequest = ASAuthorizationPasswordProvider().createRequest()\n\n    let controller = ASAuthorizationController(\n        authorizationRequests: [appleIDRequest, passwordRequest]\n    )\n    controller.delegate = self\n    controller.presentationContextProvider = self\n    controller.performRequests(\n        options: .preferImmediatelyAvailableCredentials\n    )\n}\n```\n\nCall this in `viewDidAppear` or on app launch. If no existing credentials\nare found, the delegate receives a `.notInteractive` error -- handle it\nsilently and show your normal login UI.\n\n## ASWebAuthenticationSession (OAuth)\n\nUse `ASWebAuthenticationSession` for OAuth and third-party authentication\n(Google, GitHub, etc.). Never use `WKWebView` for auth flows.\n\n```swift\nimport AuthenticationServices\n\nfinal class OAuthController: NSObject, ASWebAuthenticationPresentationContextProviding {\n    func startOAuthFlow() {\n        let authURL = URL(string:\n            \"https://provider.com/oauth/authorize?client_id=YOUR_ID&redirect_uri=myapp://callback&response_type=code\"\n        )!\n        let session = ASWebAuthenticationSession(\n            url: authURL, callback: .customScheme(\"myapp\")\n        ) { callbackURL, error in\n            guard let callbackURL, error == nil,\n                  let code = URLComponents(url: callbackURL, resolvingAgainstBaseURL: false)?\n                      .queryItems?.first(where: { $0.name == \"code\" })?.value else { return }\n            Task { await self.exchangeCodeForTokens(code) }\n        }\n        session.presentationContextProvider = self\n        session.prefersEphemeralWebBrowserSession = true  // No shared cookies\n        session.start()\n    }\n\n    func presentationAnchor(for session: ASWebAuthenticationSession) -> ASPresentationAnchor {\n        ASPresentationAnchor()\n    }\n}\n```\n\n### SwiftUI WebAuthenticationSession\n\n```swift\nstruct OAuthLoginView: View {\n    @Environment(\\.webAuthenticationSession) private var webAuthSession\n\n    var body: some View {\n        Button(\"Sign in with Provider\") {\n            Task {\n                let url = URL(string: \"https://provider.com/oauth/authorize?client_id=YOUR_ID\")!\n                let callbackURL = try await webAuthSession.authenticate(\n                    using: url, callback: .customScheme(\"myapp\")\n                )\n                // Extract authorization code from callbackURL\n            }\n        }\n    }\n}\n```\n\nCallback types: `.customScheme(\"myapp\")` for URL scheme redirects;\n`.https(host:path:)` for universal link redirects (preferred).\n\n## Password AutoFill Credentials\n\nUse `ASAuthorizationPasswordProvider` to offer saved keychain credentials\nalongside Sign in with Apple:\n\n```swift\nfunc performSignIn() {\n    let appleIDRequest = ASAuthorizationAppleIDProvider().createRequest()\n    appleIDRequest.requestedScopes = [.fullName, .email]\n\n    let passwordRequest = ASAuthorizationPasswordProvider().createRequest()\n\n    let controller = ASAuthorizationController(\n        authorizationRequests: [appleIDRequest, passwordRequest]\n    )\n    controller.delegate = self\n    controller.presentationContextProvider = self\n    controller.performRequests()\n}\n\n// In delegate:\nfunc authorizationController(\n    controller: ASAuthorizationController,\n    didCompleteWithAuthorization authorization: ASAuthorization\n) {\n    switch authorization.credential {\n    case let appleIDCredential as ASAuthorizationAppleIDCredential:\n        handleAppleIDLogin(appleIDCredential)\n    case let passwordCredential as ASPasswordCredential:\n        // User selected a saved password from keychain\n        signInWithPassword(\n            username: passwordCredential.user,\n            password: passwordCredential.password\n        )\n    default:\n        break\n    }\n}\n```\n\nSet `textContentType` on text fields for AutoFill to work:\n\n```swift\nusernameField.textContentType = .username\npasswordField.textContentType = .password\n```\n\n## Biometric Authentication\n\nUse `LAContext` from LocalAuthentication for Face ID / Touch ID as a\nsign-in or re-authentication mechanism. For protecting Keychain items\nwith biometric access control (`SecAccessControl`, `.biometryCurrentSet`),\nsee the `swift-security` skill.\n\n```swift\nimport LocalAuthentication\n\nfunc authenticateWithBiometrics() async throws -> Bool {\n    let context = LAContext()\n    var error: NSError?\n\n    guard context.canEvaluatePolicy(\n        .deviceOwnerAuthenticationWithBiometrics, error: &error\n    ) else {\n        throw AuthError.biometricsUnavailable\n    }\n\n    return try await context.evaluatePolicy(\n        .deviceOwnerAuthenticationWithBiometrics,\n        localizedReason: \"Sign in to your account\"\n    )\n}\n```\n\n**Required:** Add `NSFaceIDUsageDescription` to Info.plist. Missing this\nkey crashes on Face ID devices.\n\n## SwiftUI SignInWithAppleButton\n\n```swift\nimport AuthenticationServices\n\nstruct AppleSignInView: View {\n    @Environment(\\.colorScheme) var colorScheme\n\n    var body: some View {\n        SignInWithAppleButton(.signIn) { request in\n            request.requestedScopes = [.fullName, .email]\n        } onCompletion: { result in\n            switch result {\n            case .success(let authorization):\n                guard let credential = authorization.credential\n                    as? ASAuthorizationAppleIDCredential else { return }\n                handleCredential(credential)\n            case .failure(let error):\n                handleError(error)\n            }\n        }\n        .signInWithAppleButtonStyle(\n            colorScheme == .dark ? .white : .black\n        )\n        .frame(height: 50)\n    }\n}\n```\n\n## Common Mistakes\n\n### 1. Not checking credential state on app launch\n\n```swift\n// DON'T: Assume the user is still authorized\nfunc appDidLaunch() {\n    if UserDefaults.standard.bool(forKey: \"isLoggedIn\") {\n        showMainApp()  // User may have revoked access!\n    }\n}\n\n// DO: Check credential state every launch\nfunc appDidLaunch() async {\n    await checkCredentialState()  // See \"Credential State Checking\" above\n}\n```\n\n### 2. Not performing existing account setup flows\n\n```swift\n// DON'T: Always show a full login screen on launch\n// DO: Call performExistingAccountSetupFlows() first;\n//     show login UI only if .notInteractive error received\n```\n\n### 3. Assuming email/name are always provided\n\n```swift\n// DON'T: Force-unwrap email or fullName\nlet email = credential.email!  // Crashes on subsequent logins\n\n// DO: Handle nil gracefully -- only available on first authorization\nif let email = credential.email {\n    saveEmail(email)  // Persist immediately\n}\n```\n\n### 4. Not implementing ASAuthorizationControllerPresentationContextProviding\n\n```swift\n// DON'T: Skip the presentation context provider\ncontroller.delegate = self\ncontroller.performRequests()  // May not display UI correctly\n\n// DO: Always set the presentation context provider\ncontroller.delegate = self\ncontroller.presentationContextProvider = self  // Required for proper UI\ncontroller.performRequests()\n```\n\n### 5. Storing identityToken in UserDefaults\n\n```swift\n// DON'T: Store tokens in UserDefaults\nUserDefaults.standard.set(tokenString, forKey: \"identityToken\")\n\n// DO: Store in Keychain\n// See references/keychain-biometric.md for Keychain patterns\ntry KeychainHelper.save(tokenData, forKey: \"identityToken\")\n```\n\n## Review Checklist\n\n- [ ] \"Sign in with Apple\" capability added in Xcode project\n- [ ] `ASAuthorizationControllerPresentationContextProviding` implemented\n- [ ] Credential state checked on every app launch (`credentialState(forUserID:)`)\n- [ ] `credentialRevokedNotification` observer registered; sign-out handled\n- [ ] `email` and `fullName` cached on first authorization (not assumed available later)\n- [ ] `identityToken` sent to server for validation, not trusted client-side only\n- [ ] Tokens stored in Keychain, not UserDefaults or files\n- [ ] `performExistingAccountSetupFlows` called before showing login UI\n- [ ] Error cases handled: `.canceled`, `.failed`, `.notInteractive`\n- [ ] `NSFaceIDUsageDescription` in Info.plist for biometric auth\n- [ ] `ASWebAuthenticationSession` used for OAuth (not `WKWebView`)\n- [ ] `prefersEphemeralWebBrowserSession` set for OAuth when appropriate\n- [ ] `textContentType` set on username/password fields for AutoFill\n\n## References\n\n- Keychain & biometric patterns: [references/keychain-biometric.md](references/keychain-biometric.md)\n- [AuthenticationServices](https://sosumi.ai/documentation/authenticationservices)\n- [ASAuthorizationAppleIDProvider](https://sosumi.ai/documentation/authenticationservices/asauthorizationappleidprovider)\n- [ASAuthorizationAppleIDCredential](https://sosumi.ai/documentation/authenticationservices/asauthorizationappleidcredential)\n- [ASAuthorizationController](https://sosumi.ai/documentation/authenticationservices/asauthorizationcontroller)\n- [ASWebAuthenticationSession](https://sosumi.ai/documentation/authenticationservices/aswebauthenticationsession)\n- [ASAuthorizationPasswordProvider](https://sosumi.ai/documentation/authenticationservices/asauthorizationpasswordprovider)\n- [SignInWithAppleButton](https://sosumi.ai/documentation/authenticationservices/signinwithapplebutton)\n- [Implementing User Authentication with Sign in with Apple](https://sosumi.ai/documentation/authenticationservices/implementing-user-authentication-with-sign-in-with-apple)","tags":["authentication","swift","ios","skills","dpearson2699","accessibility","agent-skills","ai-coding","apple","claude-code","codex-skills","cursor-skills"],"capabilities":["skill","source-dpearson2699","skill-authentication","topic-accessibility","topic-agent-skills","topic-ai-coding","topic-apple","topic-claude-code","topic-codex-skills","topic-cursor-skills","topic-ios","topic-ios-development","topic-liquid-glass","topic-localization","topic-mapkit"],"categories":["swift-ios-skills"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/dpearson2699/swift-ios-skills/authentication","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add dpearson2699/swift-ios-skills","source_repo":"https://github.com/dpearson2699/swift-ios-skills","install_from":"skills.sh"}},"qualityScore":"0.700","qualityRationale":"deterministic score 0.70 from registry signals: · indexed on github topic:agent-skills · 599 github stars · SKILL.md body (17,134 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-05-18T18:53:39.811Z","embedding":null,"createdAt":"2026-04-18T20:34:18.180Z","updatedAt":"2026-05-18T18:53:39.811Z","lastSeenAt":"2026-05-18T18:53:39.811Z","tsv":"'/auth/apple':627 '/auth/keys':695 '/documentation/authenticationservices)':1448 '/documentation/authenticationservices/asauthorizationappleidcredential)':1456 '/documentation/authenticationservices/asauthorizationappleidprovider)':1452 '/documentation/authenticationservices/asauthorizationcontroller)':1460 '/documentation/authenticationservices/asauthorizationpasswordprovider)':1468 '/documentation/authenticationservices/aswebauthenticationsession)':1464 '/documentation/authenticationservices/implementing-user-authentication-with-sign-in-with-apple)':1483 '/documentation/authenticationservices/signinwithapplebutton)':1472 '/oauth/authorize?client_id=your_id':898 '/oauth/authorize?client_id=your_id&redirect_uri=myapp://callback&response_type=code':820 '0.name':847 '1':1162 '2':1207 '200':657 '3':1237 '4':1276 '5':1312 '50':1159 'access':474,547,1048,1190 'accesstoken':680 'account':80,85,481,710,1090,1211 'ad':1349 'add':126,402,1092 'allow':545 'alon':587 'alongsid':940 'alway':338,339,416,1217,1241,1297 'api':138 'api.example.com':626 'api.example.com/auth/apple':625 'app':404,468,530,761,1168,1360 'appdidlaunch':1180,1198 'appl':10,43,56,61,125,131,480,688,722,944,1347,1480 'appleid.apple.com':694,700 'appleid.apple.com/auth/keys':693 'appleidcredenti':983,987 'appleidrequest':735,746,949,963 'appleidrequest.requestedscopes':952 'applesigninview':1110 'application/json':631 'appropri':1431 'asauthor':195,978 'asauthorizationappleidcredenti':13,201,325,415,592,985,1141,1453 'asauthorizationappleidprovid':11,153,492,736,950,1449 'asauthorizationappleidprovider.credentialrevokednotification':557 'asauthorizationcontrol':12,140,162,177,192,274,744,961,975,1457 'asauthorizationcontrollerdeleg':188 'asauthorizationcontrollerpresentationcontextprovid':172,1279,1353 'asauthorizationerror':283 'asauthorizationpasswordprovid':740,934,957,1465 'aspasswordcredenti':992 'aspresentationanchor':178,869,870 'assum':1173,1238,1379 'asuserdetectionstatus':369 'aswebauthenticationpresentationcontextprovid':811 'aswebauthenticationsess':20,88,91,784,787,823,868,1420,1461 'aswebauthenticationsession-oauth':90 'async':489,593,1063,1199 'aud':701 'auth':27,46,333,335,433,802,1419 'authcod':235,262,269,270,610,643 'authcodedata':607,613 'authent':1,4,29,31,51,101,104,794,1022,1040,1475 'authenticatewithbiometr':1062 'authenticatewithserv':266 'authenticationservic':37,144,806,1108,1445 'autherror':280,285 'autherror.biometricsunavailable':1079 'autherror.missingtoken':618 'autherror.servervalidationfailed':660 'authmanager.shared.signout':566 'author':194,219,226,295,383,511,910,977,1135,1178,1267,1377 'authorization.credential':199,980,1139 'authorizationcod':358,642 'authorizationcontrol':190,272,973 'authorizationrequest':163,745,962 'authurl':815,825 'autofil':48,94,98,931,1013,1438 'avail':430,1264,1380 'await':504,648,853,902,1082,1200 'backend':449,459 'base64':355,357 'behavior':329 'biometr':50,100,103,1021,1047,1418,1441 'biometric-authent':102 'biometrycurrentset':1051 'black':1156 'bodi':883,1117 'bool':1065 'break':289,309,1006 'bundl':704 'button':886 'cach':384,424,1374 'call':755,1226,1403 'callback':826,906,914 'callbackurl':829,834,841,900,913 'cancel':288,1411 'capabl':132,1348 'case':287,292,297,302,307,510,513,525,528,981,988,1132,1146,1409 'catch':542 'check':16,69,73,251,318,462,463,716,1164,1192,1205,1357 'checkcredentialst':488,1201 'checklist':116,119,1343 'class':146,808 'clear':520 'client':585,1391 'client-sid':584,1390 'code':240,286,363,367,838,848,855,911 'colorschem':1113,1115,1153 'common':110,113,1160 'common-mistak':112 'content':52,634 'content-typ':633 'context':1067,1286,1301 'context.canevaluatepolicy':1073 'context.evaluatepolicy':1083 'control':161,176,191,273,743,960,974,1049 'controller.delegate':165,748,965,1288,1303 'controller.performrequests':169,752,969,1290,1311 'controller.presentationcontextprovider':167,750,967,1305 'cooki':862 'correct':1295 'crash':1099,1255 'createrequest':737,741,951,958 'credenti':14,62,65,67,71,95,99,198,249,323,414,460,464,551,591,725,766,932,939,1138,1145,1165,1193,1203,1355 'credential-handl':64 'credential-state-check':70 'credential.authorizationcode':236,608 'credential.email':215,453,1254,1271 'credential.fullname':222,437 'credential.identitytoken':229,598 'credential.user':206,423 'credentialrevokednotif':1364 'credentialst':1362 'critic':373 'customschem':827,907,916 'dark':1154 'data':353,359,522,602,612,645,668 'decod':665 'default':319,540,1005 'deleg':180,770,971 'delet':398 'devic':1103 'deviceownerauthenticationwithbiometr':1074,1084 'didcompletewithauthor':193,976 'didcompletewitherror':275 'dismiss':291 'display':1293 'els':202,497,616,658,850,1077,1142 'email':159,214,340,374,427,452,455,954,1126,1249,1253,1270,1273,1371 'email/name':1239 'encod':604,614,639 'environ':877,1112 'error':276,278,281,322,544,774,830,835,1070,1075,1076,1149,1151,1235,1408 'etc':797 'everi':467,1195,1359 'exchang':243 'exist':79,84,709,718,765,1210 'existing-account-setup-flow':83 'exp':706 'expect':315 'extens':170,186 'extract':909 'face':1028,1101 'fail':293,296,314,1412 'failur':184,1147 'fals':843 'field':1011,1436 'file':1401 'final':145,807 'first':218,225,332,382,432,845,1228,1266,1376 'flow':28,32,82,87,393,712,803,1213 'forc':1247 'force-unwrap':1246 'forhttpheaderfield':632 'forkey':679,1183,1326,1340 'fornam':556 'foruserid':506,1363 'found':768 'frame':1157 'framework':38 'full':1220 'fullnam':158,221,346,376,436,443,953,1125,1251,1373 'func':149,173,189,271,412,487,589,732,812,864,946,972,1061,1179,1197 'github':796 'googl':795 'grace':1262 'guard':196,493,595,652,832,1072,1136 'handl':63,66,181,306,324,775,1260,1370,1410 'handleappleidlogin':986 'handlecredenti':413,1144 'handleerror':1150 'height':1158 'host':923 'https':922 'httpurlrespons':655 'id':705,1029,1031,1102 'ident':17 'identifi':212,420,537 'identitytoken':228,260,267,268,352,570,640,1314,1327,1341,1382 'immedi':386,428,565,1275 'implement':2,30,1278,1354,1473 'import':143,805,1059,1107 'includ':6,39 'info.plist':1095,1416 'initi':389 'interact':312 'invalid':300 'invalidrespons':298 'io':3,34 'isloggedin':1184 'iss':698 'item':1045 'jsondecod':664 'jsonencod':638 'jwks':696 'jwt':230,354,356,573,686 'key':691,1098 'keychain':247,255,673,938,999,1044,1331,1335,1397,1440 'keychainhelper.save':677,1338 'lacontext':1024,1068 'later':397,1381 'launch':469,714,762,1169,1196,1224,1361 'let':151,154,160,197,204,213,220,227,234,279,421,435,438,451,490,494,501,596,599,606,609,644,661,734,738,742,814,821,833,837,892,899,948,955,959,982,989,1066,1134,1137,1148,1252,1269 'likelyr':370 'link':927 'live':239,362,366 'loadsaveduserid':496 'local':521 'localauthent':1026,1060 'localizedreason':1085 'login':729,782,1221,1230,1258,1406 'loginviewcontrol':147,171,187 'main':561 'match':702 'may':472,1187,1291 'mechan':1041 'migrat':535 'migrateus':538 'miss':1096 'mistak':111,114,1161 'myapp':828,908,917 'name':425,439,445 'network':543 'never':581,798 'new':533 'nil':216,223,345,351,559,836,1261 'non':311 'non-interact':310 'normal':781 'notfound':526 'nothandl':303 'notif':553 'notificationcenter.default.addobserver':555 'notinteract':308,773,1234,1413 'nserror':1071 'nsfaceidusagedescript':1093,1414 'nsobject':810 'oauth':22,89,92,785,789,1423,1429 'oauth/third-party':44 'oauthcontrol':809 'oauthloginview':875 'object':558 'observ':1365 'offer':936 'offlin':546 'oncomplet':1127 'option':753 'parti':26,793 'pass':708 'password':47,93,97,724,930,997,1003,1020 'password-autofill-credenti':96 'passwordcredenti':990 'passwordcredential.password':1004 'passwordcredential.user':1002 'passwordfield.textcontenttype':1019 'passwordrequest':739,747,956,964 'path':924 'pattern':5,256,1336,1442 'per':210 'per-team':209 'perform':1209 'performexistingaccountsetupflow':733,1227,1402 'performsignin':947 'persist':417,446,456,1274 'personnamecompon':347 'personnamecomponentsformatt':440 'post':629 'prefer':929 'preferimmediatelyavailablecredenti':754 'prefersephemeralwebbrowsersess':1426 'present':1285,1300 'presentationanchor':174,865 'privat':879 'proceedtomainapp':512,550 'project':1352 'proper':1309 'properti':326,330 'protect':1043 'provid':152,342,348,378,491,890,1242,1287,1302 'provider.com':819,897 'provider.com/oauth/authorize?client_id=your_id':896 'provider.com/oauth/authorize?client_id=your_id&redirect_uri=myapp://callback&response_type=code':818 'provider.createrequest':156 'provider.credentialstate':505 'public':690 'queryitem':844 'queue':560 're':401,1039 're-add':400 're-authent':1038 'realuserstatus':368 'receiv':771,1236 'redirect':921,928 'refer':120,121,1439 'references/keychain-biometric.md':253,675,1333,1443,1444 'regist':1366 'request':155,164,313,344,350,620,651,1122 'request.httpbody':636 'request.httpmethod':628 'request.requestedscopes':157,1124 'request.setvalue':630 'requir':1091,1307 'resolvingagainstbaseurl':842 'respons':301,646,653 'result':1128,1131 'retri':549 'return':203,410,499,851,1080,1143 'review':115,118,1342 'review-checklist':117 'revoc':552 'revok':473,514,516,1189 'save':244,937,996 'saveemail':1272 'saveuserid':257 'scheme':920 'screen':730,1222 'secaccesscontrol':1050 'secur':485,1056 'see':252,674,1052,1202,1332 'select':994 'self':166,168,749,751,857,966,968,1289,1304,1306 'self.exchangecodefortokens':854 'send':259,574 'sendtokentoserv':590 'sent':1383 'server':232,242,265,578,682,1385 'server-sid':681 'session':662,670,822,867 'session.accesstoken':678 'session.prefersephemeralwebbrowsersession':858 'session.presentationcontextprovider':856 'session.start':863 'sessionresponse.self':666 'set':479,1007,1298,1427,1433 'setup':81,86,141,711,1212 'share':861 'short':238,361,365 'short-liv':237,360,364 'show':727,779,1218,1229,1405 'showerror':294,299,304,320 'showloginscreen':498,524,527,541 'showmainapp':1185 'side':586,683,1392 'sign':7,40,53,58,122,128,391,483,517,563,719,887,941,1035,1086,1344,1368,1477 'sign-in':482,1034 'sign-in-with-appl':57 'sign-out':1367 'sign-up':390 'signin':1121 'signinwithapplebutton':106,109,1105,1120,1469 'signinwithapplebuttonstyl':1152 'signinwithpassword':1000 'signout':523 'silent':317,715,777 'skill':1057 'skill-authentication' 'skip':1283 'sosumi.ai':1447,1451,1455,1459,1463,1467,1471,1482 'sosumi.ai/documentation/authenticationservices)':1446 'sosumi.ai/documentation/authenticationservices/asauthorizationappleidcredential)':1454 'sosumi.ai/documentation/authenticationservices/asauthorizationappleidprovider)':1450 'sosumi.ai/documentation/authenticationservices/asauthorizationcontroller)':1458 'sosumi.ai/documentation/authenticationservices/asauthorizationpasswordprovider)':1466 'sosumi.ai/documentation/authenticationservices/aswebauthenticationsession)':1462 'sosumi.ai/documentation/authenticationservices/implementing-user-authentication-with-sign-in-with-apple)':1481 'sosumi.ai/documentation/authenticationservices/signinwithapplebutton)':1470 'source-dpearson2699' 'stabl':207 'startoauthflow':813 'startsigninwithappl':150 'state':15,68,72,250,461,465,502,509,1166,1194,1204,1356 'statuscod':656 'still':1177 'store':669,1313,1320,1329,1395 'string':337,341,441,601,611,624,817,895 'struct':874,1109 'subsequ':334,1257 'success':182,1133 'swift':142,185,411,486,554,588,731,804,873,945,1016,1055,1058,1106,1170,1214,1243,1280,1317 'swift-secur':1054 'swiftui':105,108,871,1104 'swiftui-signinwithapplebutton':107 'switch':284,508,979,1130 'task':852,891 'team':211,534 'text':1010 'textcontenttyp':1008,1432 'third':25,792 'third-parti':24,791 'throw':594,617,659,1064,1078 'time':477 'token':18,74,77,567,600,641,671,1321,1394 'token-valid':76 'tokendata':597,603,1339 'tokenstr':1325 'topic-accessibility' 'topic-agent-skills' 'topic-ai-coding' 'topic-apple' 'topic-claude-code' 'topic-codex-skills' 'topic-cursor-skills' 'topic-ios' 'topic-ios-development' 'topic-liquid-glass' 'topic-localization' 'topic-mapkit' 'touch':1030 'transfer':529,531 'tri':503,637,647,663,676,901,1081,1337 'true':859 'trust':582,1389 'type':331,635,915 'ui':783,1231,1294,1310,1407 'uikit':139 'uiviewcontrol':148 'uniqu':208 'univers':926 'unknown':321,371,372,539 'unwrap':1248 'url':622,623,816,824,840,893,894,905,919 'urlcompon':839 'urlrequest':621 'urlsession.shared.data':649 'use':35,136,786,799,904,933,1023,1421 'user':290,336,396,419,471,515,536,993,1175,1186,1474 'userdefault':1316,1323,1399 'userdefaults.standard.bool':1182 'userdefaults.standard.set':1324 'userid':205,245,258,422,495,507 'usernam':1001,1018 'username/password':1435 'usernamefield.textcontenttype':1017 'userprofile.saveemail':454 'userprofile.savename':444 'utf8':605,615 'valid':19,75,78,233,568,580,684,1387 'valu':406,849 'var':619,880,882,1069,1114,1116 'verifi':697 'via':478 'view':876,885,1111,1119 'view.window':179 'viewdidappear':758 'web':45 'webauthenticationsess':872,878 'webauthsess':881 'webauthsession.authenticate':903 'white':1155 'wkwebview':800,1425 'work':1015 'xcode':134,1351","prices":[{"id":"cc567a17-4136-4757-8022-2db0670cf27b","listingId":"15d9ee11-2f18-4898-84da-301a8d181042","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"dpearson2699","category":"swift-ios-skills","install_from":"skills.sh"},"createdAt":"2026-04-18T20:34:18.180Z"}],"sources":[{"listingId":"15d9ee11-2f18-4898-84da-301a8d181042","source":"github","sourceId":"dpearson2699/swift-ios-skills/authentication","sourceUrl":"https://github.com/dpearson2699/swift-ios-skills/tree/main/skills/authentication","isPrimary":false,"firstSeenAt":"2026-04-18T22:00:45.664Z","lastSeenAt":"2026-05-18T18:53:39.811Z"},{"listingId":"15d9ee11-2f18-4898-84da-301a8d181042","source":"skills_sh","sourceId":"dpearson2699/swift-ios-skills/authentication","sourceUrl":"https://skills.sh/dpearson2699/swift-ios-skills/authentication","isPrimary":true,"firstSeenAt":"2026-04-18T20:34:18.180Z","lastSeenAt":"2026-05-07T22:40:33.408Z"}],"details":{"listingId":"15d9ee11-2f18-4898-84da-301a8d181042","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"dpearson2699","slug":"authentication","github":{"repo":"dpearson2699/swift-ios-skills","stars":599,"topics":["accessibility","agent-skills","ai-coding","apple","claude-code","codex-skills","cursor-skills","ios","ios-development","liquid-glass","localization","mapkit","networking","storekit","swift","swift-concurrency","swiftdata","swiftui","widgetkit","xcode"],"license":"other","html_url":"https://github.com/dpearson2699/swift-ios-skills","pushed_at":"2026-04-26T21:04:17Z","description":"Agent Skills for iOS 26+, Swift 6.3, SwiftUI, and modern Apple frameworks","skill_md_sha":"eba5b9bc2e45d2dd0f56d52e946f0301950b6f6a","skill_md_path":"skills/authentication/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/dpearson2699/swift-ios-skills/tree/main/skills/authentication"},"layout":"multi","source":"github","category":"swift-ios-skills","frontmatter":{"name":"authentication","description":"Implement iOS authentication patterns including Sign in with Apple (ASAuthorizationAppleIDProvider, ASAuthorizationController, ASAuthorizationAppleIDCredential), credential state checking, identity token validation, ASWebAuthenticationSession for OAuth and third-party auth flows, ASAuthorizationPasswordProvider for AutoFill credential suggestions, and biometric authentication with LAContext. Use when implementing Sign in with Apple, handling Apple ID credentials, building OAuth login flows, integrating Password AutoFill, checking credential revocation state, or validating identity tokens server-side."},"skills_sh_url":"https://skills.sh/dpearson2699/swift-ios-skills/authentication"},"updatedAt":"2026-05-18T18:53:39.811Z"}}