Skip to content

Commit 2666697

Browse files
authored
Merge pull request #89643 from TylerMSFT/twhitney-objc-techreview
Twhitney objc techreview
2 parents f23196a + cd7b034 commit 2666697

File tree

1 file changed

+27
-30
lines changed

1 file changed

+27
-30
lines changed

articles/active-directory/develop/quickstart-v2-ios.md

Lines changed: 27 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ ms.devlang: na
1313
ms.topic: quickstart
1414
ms.tgt_pltfrm: na
1515
ms.workload: identity
16-
ms.date: 09/16/2019
16+
ms.date: 09/24/2019
1717
ms.author: twhitney
1818
ms.reviewer: jmprieur, saeeda
1919
ms.custom: aaddev, identityplatformtop40
@@ -25,7 +25,7 @@ ms.collection: M365-identity-device-management
2525

2626
This quickstart contains a code sample that demonstrates how a native iOS or macOS application can sign in personal, work and school accounts, get an access token, and call the Microsoft Graph API.
2727

28-
This quickstart is applicable to both iOS and macOS apps. Some steps are needed only for iOS apps. Those steps call out that they are only for iOS.
28+
This quickstart applies to both iOS and macOS apps. Some steps are needed only for iOS apps. Those steps call out that they are only for iOS.
2929

3030
![Shows how the sample app generated by this quickstart works](media/quickstart-v2-ios/ios-intro.svg)
3131

@@ -38,10 +38,10 @@ This quickstart is applicable to both iOS and macOS apps. Some steps are needed
3838
> [!div renderon="docs"]
3939
> ## Register and download your quickstart app
4040
> You have two options to start your quickstart application:
41-
> * [Express] [Option 1: Register and auto configure your app and then download your code sample](#option-1-register-and-auto-configure-your-app-and-then-download-your-code-sample)
41+
> * [Express] [Option 1: Register and auto configure your app and then download your code sample](#option-1-register-and-auto-configure-your-app-and-then-download-the-code-sample)
4242
> * [Manual] [Option 2: Register and manually configure your application and code sample](#option-2-register-and-manually-configure-your-application-and-code-sample)
4343
>
44-
> ### Option 1: Register and auto configure your app and then download your code sample
44+
> ### Option 1: Register and auto configure your app and then download the code sample
4545
> #### Step 1: Register your application
4646
> To register your app,
4747
> 1. Go to the new [Azure portal - App registrations](https://portal.azure.com/#blade/Microsoft_AAD_RegisteredApps/applicationsListBlade/quickStartType/IosQuickstartPage/sourceType/docs) pane.
@@ -58,15 +58,15 @@ This quickstart is applicable to both iOS and macOS apps. Some steps are needed
5858
> 1. When the **Register an application** page appears, enter your application's registration information:
5959
> - In the **Name** section, enter a meaningful application name that will be displayed to users of the app when they sign in or consent to your app.
6060
> - Skip other configurations on this page.
61-
> - Hit the `Register` button.
61+
> - Select `Register`.
6262
> 1. In the **Manage** section, select `Authentication` > `Add Platform` > `iOS`.
63-
> - Enter the ***Bundle Identifier*** for your application.
63+
> - Enter the ***Bundle Identifier*** for your application. The bundle identifier is just a unique string that uniquely identifies your application, for example `com.<yourname>.identitysample.MSALMacOS`. Make a note of the value you use.
6464
> - Note that the iOS configuration is also applicable to macOS applications.
65-
> 1. Select `Configure` and save the ***MSAL Configuration*** details for later.
65+
> 1. Select `Configure` and save the ***MSAL Configuration*** details for later in this quickstart.
6666
> [!div renderon="portal" class="sxs-lookup"]
6767
>
6868
> #### Step 1: Configure your application
69-
> For the code sample for this quickstart to work, you need to add a redirect URI compatible with the Auth broker.
69+
> For the code sample for this quickstart to work, you need to add a redirect URI compatible with the Auth broker.
7070
> > [!div renderon="portal" id="makechanges" class="nextstepaction"]
7171
> > [Make this change for me]()
7272
>
@@ -80,7 +80,7 @@ This quickstart is applicable to both iOS and macOS apps. Some steps are needed
8080

8181
#### Step 3: Install dependencies
8282

83-
In a terminal window, navigate to the folder with the downloaded code sample and run `pod install` to install the latest MSAL library
83+
In a terminal window, navigate to the folder with the downloaded code sample and run `pod install` to install the latest MSAL library.
8484

8585
#### Step 4: Configure your project
8686

@@ -89,13 +89,13 @@ In a terminal window, navigate to the folder with the downloaded code sample and
8989
9090
> [!div renderon="portal" class="sxs-lookup"]
9191
> 1. Extract the zip file and open the project in XCode.
92-
> 1. Edit **ViewController.swift** and replace the line starting with 'let kClientID' with the following code snippet:
92+
> 1. Edit **ViewController.swift** and replace the line starting with 'let kClientID' with the following code snippet. Remember to update the value for `kClientID` with the client ID that you saved when you registered your app in the portal earlier in the quickstart:
9393
> ```swift
94-
> let kClientID = "Enter_the_Application_Id_here"
95-
> let kAuthority = "https://login.microsoftonline.com/Enter_the_Tenant_Info_Here"
94+
> let kClientID = "<ENTER_YOUR_APPLICATION/CLIENT_ID>"
9695
> ```
96+
> 1. Open the project settings. In the **Identity** section, enter the **Bundle Identifier** that you entered into the portal.
9797
> 1. For iOS only, right-click **Info.plist** and select **Open As** > **Source Code**.
98-
> 1. For iOS only, under the dict root node, replace with your ***Bundle Id***:
98+
> 1. For iOS only, under the dict root node, replace `Enter_the_bundle_Id_Here`with the ***Bundle Id*** that you entered in the portal.
9999
>
100100
> ```xml
101101
> <key>CFBundleURLTypes</key>
@@ -107,7 +107,6 @@ In a terminal window, navigate to the folder with the downloaded code sample and
107107
> </array>
108108
> </dict>
109109
> </array>
110-
>
111110
> ```
112111
> 1. Build & run the app!
113112
> [!div class="sxs-lookup" renderon="portal"]
@@ -116,34 +115,33 @@ In a terminal window, navigate to the folder with the downloaded code sample and
116115
> [!div renderon="docs"]
117116
>
118117
> 1. Extract the zip file and open the project in XCode.
119-
> 1. Edit **ViewController.swift** and replace the line starting with 'let kClientID' with the following code snippet:
120-
>
118+
> 1. Edit **ViewController.swift** and replace the line starting with 'let kClientID' with the following code snippet. Remember to update the value for `kClientID` with the clientID that you saved when you registered your app in the portal earlier in this quickstart:
121119
> ```swift
122120
> let kClientID = "<ENTER_YOUR_APPLICATION/CLIENT_ID>"
123-
>
124121
> ```
122+
> 1. Open the project settings. In the **Identity** section, enter the **Bundle Identifier** that you entered into the portal.
125123
> 1. For iOS only, right-click **Info.plist** and select **Open As** > **Source Code**.
126-
> 1. For iOS only, under the dict root node, replace with your ***Bundle Id***:
124+
> 1. For iOS only, under the dict root node, replace `Enter_the_bundle_Id_Here`with the ***Bundle Id*** that you used in the portal.
127125
>
128126
> ```xml
129127
> <key>CFBundleURLTypes</key>
130128
> <array>
131129
> <dict>
132130
> <key>CFBundleURLSchemes</key>
133131
> <array>
134-
> <string>msauth.<ENTER_YOUR_BUNDLE_ID></string>
132+
> <string>msauth.Enter_the_Bundle_Id_Here</string>
135133
> </array>
136134
> </dict>
137135
> </array>
138-
>
136+
>
139137
> ```
140138
> 1. Build & run the app!
141139
142140
## More Information
143141
144142
Read these sections to learn more about this quickstart.
145143
146-
### Getting MSAL
144+
### Get MSAL
147145
148146
MSAL ([MSAL.framework](https://github.com/AzureAD/microsoft-authentication-library-for-objc)) is the library used to sign in users and request tokens used to access an API protected by Microsoft identity platform. You can add MSAL to your application using the following process:
149147
@@ -166,7 +164,7 @@ Run CocoaPods installation command:
166164
167165
```pod install```
168166
169-
### MSAL initialization
167+
### Initialize MSAL
170168
171169
You can add the reference for MSAL by adding the following code:
172170
@@ -181,7 +179,6 @@ let authority = try MSALAADAuthority(url: URL(string: kAuthority)!)
181179
182180
let msalConfiguration = MSALPublicClientApplicationConfig(clientId: kClientID, redirectUri: nil, authority: authority)
183181
self.applicationContext = try MSALPublicClientApplication(configuration: msalConfiguration)
184-
185182
```
186183
187184
> |Where: ||
@@ -192,7 +189,7 @@ self.applicationContext = try MSALPublicClientApplication(configuration: msalCon
192189
193190
### For iOS only, additional app requirements
194191
195-
Your app must also have the following in your `AppDelegate`. This lets MSAL SDK handle token response from the Auth broker app when you perform authentication.
192+
Your app must also have the following in your `AppDelegate`. This lets MSAL SDK handle token response from the Auth broker app when you do authentication.
196193
197194
```swift
198195
func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
@@ -223,7 +220,7 @@ Your app must also have the following in your `AppDelegate`. This lets MSAL SDK
223220
}
224221
```
225222
226-
Finally, your app must has an `LSApplicationQueriesSchemes` entry in your ***Info.plist*** alongside the `CFBundleURLTypes`. The sample comes with this included.
223+
Finally, your app must have an `LSApplicationQueriesSchemes` entry in your ***Info.plist*** alongside the `CFBundleURLTypes`. The sample comes with this included.
227224
228225
```xml
229226
<key>LSApplicationQueriesSchemes</key>
@@ -233,16 +230,16 @@ Finally, your app must has an `LSApplicationQueriesSchemes` entry in your ***Inf
233230
</array>
234231
```
235232
236-
### Sign in users & Request tokens
233+
### Sign in users & request tokens
237234
238235
MSAL has two methods used to acquire tokens: `acquireToken` and `acquireTokenSilent`.
239236
240-
#### acquireToken: Getting a token interactively
237+
#### acquireToken: Get a token interactively
241238
242239
Some situations require users to interact with Microsoft identity platform. In these cases, the end user may be required to select their account, enter their credentials, or consent to your app's permissions. For example,
243240
244241
* The first time users sign in to the application
245-
* If a user resets their password, they will need to enter their credentials
242+
* If a user resets their password, they'll need to enter their credentials
246243
* When your application is requesting access to a resource for the first time
247244
* When MFA or other Conditional Access policies are required
248245
@@ -255,7 +252,7 @@ self.applicationContext!.acquireToken(with: parameters) { (result, error) in /*
255252
> |---------|---------|
256253
> | `scopes` | Contains the scopes being requested (that is, `[ "user.read" ]` for Microsoft Graph or `[ "<Application ID URL>/scope" ]` for custom Web APIs (`api://<Application ID>/access_as_user`) |
257254
258-
#### acquireTokenSilent: Getting an access token silently
255+
#### acquireTokenSilent: Get an access token silently
259256
260257
Apps shouldn't require their users to sign in every time they request a token. If the user has already signed in, this method allows apps to request tokens silently.
261258
@@ -275,7 +272,7 @@ self.applicationContext!.acquireTokenSilent(with: silentParams) { (result, error
275272
276273
Try out the iOS tutorial for a complete step-by-step guide on building applications, including a complete explanation of this quickstart.
277274
278-
### Learn the steps to create the application used in this quickstart
275+
### Learn how to create the application used in this quickstart
279276
280277
> [!div class="nextstepaction"]
281278
> [Call Graph API iOS tutorial](https://docs.microsoft.com/azure/active-directory/develop/guidedsetups/active-directory-ios)

0 commit comments

Comments
 (0)