Skip to content

Commit 4e056d8

Browse files
authored
Merge pull request #103204 from TylerMSFT/twhitney-github46979
Twhitney github46979
2 parents 76e64e3 + c480d9c commit 4e056d8

File tree

2 files changed

+22
-12
lines changed

2 files changed

+22
-12
lines changed
54.6 KB
Loading

articles/active-directory/develop/single-sign-on-macos-ios.md

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ ms.devlang: na
1414
ms.topic: conceptual
1515
ms.tgt_pltfrm: na
1616
ms.workload: identity
17-
ms.date: 08/28/2019
17+
ms.date: 02/03/2020
1818
ms.author: twhitney
1919
ms.reviewer:
2020
ms.custom: aaddev
@@ -67,9 +67,9 @@ For the Microsoft identity platform to know which applications can share tokens,
6767

6868
The way the Microsoft identity platform tells apps that use the same Application ID apart is by their **Redirect URIs**. Each application can have multiple Redirect URIs registered in the onboarding portal. Each app in your suite will have a different redirect URI. For example:
6969

70-
App1 Redirect URI: `msauth.com.contoso.mytestapp1://auth`
71-
App2 Redirect URI: `msauth.com.contoso.mytestapp2://auth`
72-
App3 Redirect URI: `msauth.com.contoso.mytestapp3://auth`
70+
App1 Redirect URI: `msauth.com.contoso.mytestapp1://auth`
71+
App2 Redirect URI: `msauth.com.contoso.mytestapp2://auth`
72+
App3 Redirect URI: `msauth.com.contoso.mytestapp3://auth`
7373

7474
> [!IMPORTANT]
7575
> The format of redirect uris must be compatible with the format MSAL supports, which is documented in [MSAL Redirect URI format requirements](redirect-uris-ios.md#msal-redirect-uri-format-requirements).
@@ -94,6 +94,18 @@ When you have the entitlements set up correctly, you'll see a `entitlements.plis
9494
</plist>
9595
```
9696

97+
#### Add a new keychain group
98+
99+
Add a new keychain group to your project **Capabilities**. The keychain group should be:
100+
* `com.microsoft.adalcache` on iOS
101+
* `com.microsoft.identity.universalstorage` on macOS.
102+
103+
![keychain example](media/single-sign-on-macos-ios/keychain-example.png)
104+
105+
For more information, see [keychain groups](howto-v2-keychain-objc.md).
106+
107+
## Configure the application object
108+
97109
Once you have the keychain entitlement enabled in each of your applications, and you're ready to use SSO, configure `MSALPublicClientApplication` with your keychain access group as in the following example:
98110

99111
Objective-C:
@@ -111,17 +123,15 @@ Swift:
111123
```swift
112124
let config = MSALPublicClientApplicationConfig(clientId: "<my-client-id>")
113125
config.cacheConfig.keychainSharingGroup = "my.keychain.group"
114-
126+
115127
do {
116-
let application = try MSALPublicClientApplication(configuration: config)
117-
// continue on with application
128+
let application = try MSALPublicClientApplication(configuration: config)
129+
// continue on with application
118130
} catch let error as NSError {
119131
// handle error here
120-
}
132+
}
121133
```
122134

123-
124-
125135
> [!WARNING]
126136
> When you share a keychain across your applications, any application can delete users or even all of the tokens across your application.
127137
> This is particularly impactful if you have applications that rely on tokens to do background work.
@@ -204,7 +214,7 @@ func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>)
204214
MSALPublicClientApplication.handleMSALResponse(url, sourceApplication: sourceApp)
205215
}
206216
```
207-
217+
208218
## Next steps
209219

210-
Learn more about [Authentication flows and application scenarios](authentication-flows-app-scenarios.md)
220+
Learn more about [Authentication flows and application scenarios](authentication-flows-app-scenarios.md)

0 commit comments

Comments
 (0)