

Also from Kynth Studios


Also from Kynth Studios


Also from Kynth Studios
1# Cursor Instructions for MSAL iOS/macOS23## Repository Overview45This is the **Microsoft Authentication Library (MSAL) for iOS and macOS** - an authentication SDK for integrating Microsoft identity platform authentication into native Apple applications. The library supports OAuth2/OpenID Connect protocols for Microsoft Entra ID (workforce), External ID (customers), Azure AD B2C, and personal Microsoft accounts.67**Key Facts:**89- **Languages:** Objective-C (primary), Swift (native auth APIs)10- **Platforms:** iOS 16+, macOS 11+, visionOS 1.2+11- **Distribution:** CocoaPods, Carthage, Swift Package Manager, Git submodule12- **Submodule:** `MSAL/IdentityCore` contains shared common code (do NOT make direct changes without understanding impact)1314## Critical: Architecture & Project Structure1516### Main Workspace & Targets1718- **Workspace:** `MSAL.xcworkspace` (ALWAYS use .xcworkspace, NEVER .xcodeproj directly)19- **Main Project:** `MSAL/MSAL.xcodeproj`20- **Submodule:** `MSAL/IdentityCore` - shared common library (git submodule)2122### Source Code Organization2324```25MSAL/src/26├── public/ # Public API headers (MSAL prefix)27│ ├── MSAL.h # Main umbrella header28│ ├── ios/ # iOS-specific public headers29│ ├── mac/ # macOS-specific public headers30│ ├── configuration/ # Configuration classes31│ └── native_auth/public/ # Native auth public APIs (Swift)32├── MSALPublicClientApplication.m # Main SDK entry point33├── configuration/ # Internal configuration34├── instance/ # Authority/instance handling35├── native_auth/ # Native authentication (Swift + Obj-C bridge)36├── telemetry/ # Telemetry implementation37└── util/ # Utilities38```3940### Public API Files4142Public headers MUST be in:4344- `MSAL/src/public/*.h` (shared)45- `MSAL/src/public/ios/*.h` (iOS only)46- `MSAL/src/public/mac/*.h` (macOS only)47- `MSAL/src/public/configuration/*.h` (config classes)48- `MSAL/src/native_auth/public/` (native auth - Swift)4950### Configuration Files5152- **Build configs:** `MSAL/xcconfig/*.xcconfig` - Xcode build settings53- **Swift lint:** `MSAL/.swiftlint.yml` - only applies to `src/native_auth`54- **CocoaPods:** `MSAL.podspec` - pod spec with `app-lib` and `native-auth` subspecs55- **Swift PM:** `Package.swift` - binary framework distribution56- **Privacy:** `MSAL/PrivacyInfo.xcprivacy` - Apple privacy manifest5758## Testing5960**Unit Tests:** Located in `MSAL/test/unit/`61**Integration Tests:** Located in `MSAL/test/integration/`62**Automation Tests:** Located in `MSAL/test/automation/` (requires conf.json - not in repo)6364**Running Tests:**6566- Via Xcode: Select scheme and Cmd+U67- E2E tests require test configuration from Azure KeyVault (CI only)6869## Code Style Guidelines7071**READ:** `.clinerules/04-Code-style-guidelines.md` - Contains mandatory Objective-C style rules7273**Key Rules (Repository-Specific):**74751. **Opening braces on NEW line** (differs from most Obj-C guides)762. **4-space indentation** (never tabs)773. **Imports NOT grouped** - list without organizing comments784. **Error handling:** Check return value, NEVER the error variable directly795. **Prefixes:** `MSAL` for public classes, `MSID` for IdentityCore internal806. **Properties over ivars:** Use `@property` declarations817. **Swift lint:** Native auth code must pass SwiftLint (line length: 150)8283**Example:**8485```objc86- (BOOL)performOperationWithError:(NSError **)error87{88 NSError *internalError = nil;89 BOOL result = [self doSomethingWithError:&internalError];9091 if (!result) // Check return value, not error92 {93 if (error) *error = internalError;94 return NO;95 }9697 return YES;98}99```100101## Making Changes102103### Adding New Public API1041051. Add header to appropriate `MSAL/src/public/` subdirectory1062. Import in `MSAL/src/public/MSAL.h` umbrella header1073. Update `MSAL.podspec` if needed (public_header_files)1084. Add to `MSAL/module.modulemap` if using native auth subspec1095. Document in header comments (Jazzy-compatible)110111### Modifying Build Settings1121131. Edit appropriate `.xcconfig` file in `MSAL/xcconfig/`1142. Settings cascade: specific → platform → common1153. Test both Debug and Release configurations116117### Adding Dependencies118119**Internal:** Avoid. This library should be self-contained.120**External (IdentityCore):** Coordinate with common library team.121122### Modifying IdentityCore Submodule1231241. Make changes in IdentityCore repo separately1252. Update submodule reference: `cd MSAL/IdentityCore && git checkout <commit>`1263. Commit submodule update in MSAL repo1274. Test thoroughly - affects BOTH MSAL and ADAL128129## Key Files to Never Modify130131- `MSAL/IdentityCore/` - managed as submodule132- `Package.swift` - auto-generated by release process133- `MSAL.zip` - binary distribution artifact134- `build/` - build artifacts directory135- `.xcuserdata/` - user-specific Xcode settings136137## Trust These Instructions138139These instructions have been validated against the actual build system, CI pipelines, and codebase structure. If you encounter conflicts between these instructions and other information:1401411. **Trust these instructions FIRST**1422. Only search for additional information if:143 - Instructions are incomplete for your specific task144 - You encounter an error not covered here145 - You need API usage examples (see `.clinerules/03-MSAL-API-usage.md` for MSAL API samples)146 - You need to create a new application with MSAL authentication (see `.clinerules/AGENTS.md` for details about the different options the user can select)147 - You are implementing a new feature in MSAL library, it needs to be guarded by a feature flag (see `.clinerules/05-feature-gating.md` for guidelines)148149**When searching:**150151- Check `.clinerules/*.md` for code style specifics, API usage, configuration steps and feature flag guidance.152- Check `README.md` for user-facing documentation153- Check `CHANGELOG.md` for version history and breaking changes154- Check specific xcconfig files for build settings155
One repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| AzureAD/microsoft-authentication-library-for-objcCLAUDE.md · 345 | CLAUDE.md | buildteststylearch+6 | 76/100 | today | |
| AzureAD/microsoft-authentication-library-for-objc.clinerules/02-External-tenant-configuration.md · 345 | Cline rules | setupbuildteststyle+7 | 69/100 | 14 days ago | |
| AzureAD/microsoft-authentication-library-for-objc.clinerules/04-Code-style-guidelines.md · 345 | Cline rules | lint-formatstylearchtypes+5 | 73/100 | today | |
| AzureAD/microsoft-authentication-library-for-objc.clinerules/05-feature-gating.md · 345 | Cline rules | stylearchdependenciesperformance+2 | 61/100 | 14 days ago | |
| AzureAD/microsoft-authentication-library-for-objc.clinerules/AGENTS.md · 345 | AGENTS.md | buildteststyleapi+2 | 82/100 | today | |
| AzureAD/microsoft-authentication-library-for-objc.github/copilot-instructions.md · 345 | Copilot instructions | setupbuildteststyle+11 | 64/100 | 14 days ago | |
| AzureAD/microsoft-authentication-library-for-objcAGENTS.md · 345 | AGENTS.md | buildteststylearch+6 | 76/100 | 14 days ago | |
| AzureAD/microsoft-authentication-library-for-objc.clinerules/06-Customer-communication-guidelines.md · 345 | Cline rules | stylemonorepodo-notagent-behaviour | 51/100 | 14 days ago | |
| AzureAD/microsoft-authentication-library-for-objc.clinerules/01-Workforce-tenant-configuration.md · 345 | Cline rules | setupbuildtestarch+5 | 58/100 | 14 days ago | |
| AzureAD/microsoft-authentication-library-for-objc.clinerules/03-MSAL-API-usage.md · 345 | Cline rules | styleapi | 58/100 | 14 days ago |
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| TechSquidTV/Hermes.cursor/rules/10-hermes-api.mdc · 46 | Cursor rules | testlint-formatstylearch+5 | 100/100 | 14 days ago | |
| hiromaily/go-crypto-wallet.cursor/rules/typescript.mdc · 126 | Cursor rules | setupbuildtestlint-format+6 | 100/100 | 14 days ago | |
| bybren-llc/safe-agentic-workflow.cursor/rules/10-backend-python.mdc · 399 | Cursor rules | testlint-formatstylegit+4 | 97/100 | today | |
| langflow-ai/langflow.cursor/rules/docs_development.mdc · 153k | Cursor rules | setupbuildtestlint-format+7 | 97/100 | 14 days ago | |
| TechSquidTV/Hermes.cursor/rules/20-hermes-api-tests.mdc · 46 | Cursor rules | teststyletesting-strategysecurity+3 | 97/100 | 14 days ago | |
| skillrecordings/egghead-next.cursor/rules/project-update-user-rules.mdc · 1.4k | Cursor rules | buildtestlint-formatstyle+7 | 96/100 | 14 days ago | |
| skillrecordings/egghead-next.cursor/rules/project-update-rules.mdc · 1.4k | Cursor rules | buildtestlint-formatstyle+7 | 96/100 | 14 days ago | |
| skillrecordings/egghead-next.cursor/rules/gh-task-plan.mdc · 1.4k | Cursor rules | teststylearchtypes+2 | 96/100 | 14 days ago |
A badge carrying the measured quality of the strongest agent config file in this repository, out of 100. It reads from this index every time somebody loads your page, so it changes when the measurement changes and there is nothing to keep up to date. Free, no account, and the value is not something you or we can set by hand.
[](https://rulestack.kynth.studio/configs/azuread-microsoft-authentication-library-for-objc-cursor-rules-ruler-cursor-instructions)Would rather not hotlink us? Every badge is also served in shields.io’s endpoint schema, so shields renders the image and your readers never talk to our domain:
Published by Toolproof, the masthead over this index and eight others. The method behind the number is at toolproof.kynth.studio/methodology, and the whole thing is readable as JSON with no key at /api.