You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The MSAL library for iOS gives your app the ability to begin using the [Microsoft identity platform](https://aka.ms/aaddev) by supporting [Microsoft Azure Active Directory](https://azure.microsoft.com/services/active-directory/) and [Microsoft Accounts](https://account.microsoft.com/) in a converged experience using industry standard OAuth2 and OpenID Connect. This sample demonstrates all the normal lifecycles your application should experience, including:
18
+
The MSAL library for iOS gives your app the ability to begin using the [Microsoft identity platform](https://aka.ms/aaddev) by supporting [Microsoft Azure Active Directory](https://azure.microsoft.com/en-us/services/active-directory/) and [Microsoft Accounts](https://account.microsoft.com) in a converged experience using industry standard OAuth2 and OpenID Connect. This sample demonstrates all the normal lifecycles your application should experience, including:
19
19
20
20
- How to get a token
21
21
- How to refresh a token
@@ -24,7 +24,7 @@ The MSAL library for iOS gives your app the ability to begin using the [Microsof
24
24
25
25
## Scenario
26
26
27
-
This app is a multi-tenant app meaning it can be used by any Azure AD tenant or Microsoft Account. It demonstrates how a developer can build apps to connect with enterprise users and access their Azure + O365 data via the Microsoft Graph. During the auth flow, end users will be required to sign in and consent to the permissions of the application, and in some cases may require an admin to consent to the app. The majority of the logic in this sample shows how to auth an end user and make a basic call to the Microsoft Graph.
27
+
This app is a multi-tenant app meaning it can be used within any Azure AD tenant and also supports signing in with Microsoft Account. It demonstrates how a developer can build apps to connect with enterprise users and access their Azure + O365 data via the Microsoft Graph. During the auth flow, end users will be required to sign in and consent to the permissions of the application, and in some cases may require an admin to consent to the app. The majority of the logic in this sample shows how to auth an end user and make a basic call to the Microsoft Graph.
28
28
29
29

30
30
@@ -35,7 +35,9 @@ To run this sample, you'll need:
35
35
* Xcode
36
36
* An internet connection
37
37
38
-
## Step 1: Clone or download this repository
38
+
## Step 1:
39
+
40
+
## 1A: Clone or download this repository
39
41
40
42
From Terminal:
41
43
@@ -56,99 +58,77 @@ $ pod install
56
58
$ open MSALiOS.xcworkspace
57
59
```
58
60
59
-
## Step 2: (Optional) 1A: Register your App
60
-
The app comes pre-configured for testing. If you would like to register your own app, please follow the steps below.
61
+
## Step 2: (Optional)
61
62
62
-
To Register,
63
-
1. Sign in to the [Azure portal](https://portal.azure.com) using either a work or school account.
63
+
## 2A: Register your App
64
64
65
-
2. In the left-hand navigation pane, select the **Azure Active Directory** service, and then select **App registrations**
65
+
This app comes pre-configured for testing. If you would like to register your own app, please follow the steps below.
66
66
67
-
3. You will need to have a native client application registered with Microsoft using the [App registrations](https://go.microsoft.com/fwlink/?linkid=2083908) experience.
67
+
To Register an app:
68
+
69
+
1. Sign in to the [Azure portal](https://portal.azure.com) using either a work or school account.
70
+
2. In the left-hand navigation pane, select the **Azure Active Directory** blade, and then select **App registrations**.
71
+
3. Click on the **New registration** button at the top left of the page.
72
+
4. On the app registration page,
73
+
- Name your app
74
+
- Under **Supported account types**, select **Accounts in any organizational directory (Any Azure AD directory - Multitenant) and personal Microsoft accounts (e.g. Skype, Xbox)**
75
+
- Click **Register** to finish.
76
+
5. After the app is created, you'll land on your app management page. Take note of the **Application (client) ID** as this would be needed for the step 2B below.
77
+
6. Click **Authentication**, and add new Redirect URI with type **Public client (mobile & desktop)**. Enter redirect URI in format: `msauth.<app_bundle_id>://auth`. Replace <app_bundle_id> with the **Bundle Identifier** for your application.
78
+
7. Hit the **Save** button in the top left, to save these updates.
68
79
69
-
To create an app,
70
-
1. Click the **New registration** button on the top left of the page.
71
-
2. On the app registration page,
72
-
- Name your app
73
-
- Under **Supported account types**, select **Accounts in any organizational directory and personal Microsoft accounts**
74
-
- Select **Register** to finish.
75
-
3. After the app is created, you'll land on your app management page. Click **Authentication**, and add new Redirect URI with type **Public client (mobile & desktop)**. Enter redirect URI in format: `msauth.<app.bundle.id>://auth`. Replace <app.bundle.id> with the **Bundle Identifier** for your application.
76
-
4. Hit the **Save** button in the top left, to save these updates.
80
+
## 2B: Configure your application
77
81
78
-
## 1B: Configure your application
82
+
1. Update your application's redirect URI scheme in the `Info.plist` file by replacing `msauth.com.microsoft.identitysample.MSALiOS` . Redirect URI scheme follows the format `msauth.[app_bundle_id]`. Make sure to substitue [app_bundle_id] with the **Bundle Identifier** for your application.
79
83
80
-
1. Add your application's redirect URI scheme to added in the portal to your `info.plist` file. It will be in the format of `msauth.<app.bundle.id>`
81
84
```xml
82
-
<key>CFBundleURLTypes</key>
85
+
<key>CFBundleURLTypes</key>
86
+
<array>
87
+
<dict>
88
+
<key>CFBundleURLSchemes</key>
83
89
<array>
84
-
<dict>
85
-
<key>CFBundleTypeRole</key>
86
-
<string>Editor</string>
87
-
<key>CFBundleURLName</key>
88
-
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
89
-
<key>CFBundleURLSchemes</key>
90
-
<array>
91
-
<string>msauth.<app.bundle.id></string>
92
-
</array>
93
-
</dict>
90
+
<string>msauth.[app_bundle_id]</string>
94
91
</array>
92
+
</dict>
93
+
</array>
95
94
```
96
95
97
96
2. Configure your application defaults
98
97
99
-
In the `ViewControler.swift` file, update the `kClientID` variable with your client ID.
98
+
In the `ViewControler.swift` file, update the `kClientID` variable with your Application (client) ID.
100
99
101
100
```swift
102
-
// Update the below to your client ID you received in the portal. The below is for running the demo only
101
+
// Update the client ID below with the one you received in the portal. Below ID is for running the sample app only.
103
102
104
-
let kClientID ="<your-client-id-here>"
103
+
let kClientID ="66855f8a-60cd-445e-a9bb-8cd8eadbd3fa"
105
104
```
106
105
107
106
## Step 3: Run the sample
108
107
109
-
Click the Run Button in the top menu or go to Product from the menu tab and select Run.
108
+
1. Click the Run Button in the top menu or go to Product from the menu tab and click Run.
109
+
2. Once the sample app launches, click on the 'Call Microsoft Graph API' button to go through the sign in flow and see the results from Microsoft Graph.
110
110
111
111
## Feedback, Community Help, and Support
112
112
113
-
We use [Stack Overflow](http://stackoverflow.com/questions/tagged/msal) with the community to
114
-
provide support. We highly recommend you ask your questions on Stack Overflow first and browse
115
-
existing issues to see if someone has asked your question before.
113
+
We use [Stack Overflow](http://stackoverflow.com/questions/tagged/msal) with the community to provide support. We highly recommend you ask your questions on Stack Overflow first and browse existing issues to see if someone has asked your question before.
116
114
117
-
If you find and bug or have a feature request, please raise the issue
118
-
on [GitHub Issues](../../issues).
115
+
If you find a bug or have a feature request, please raise the issue on [GitHub Issues](../../issues).
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [[email protected]](mailto:[email protected]) with any additional questions or comments.
133
124
134
125
## Security Library
135
126
136
-
This library controls how users sign-in and access services. We recommend you always take the
137
-
latest version of our library in your app when possible. We
138
-
use [semantic versioning](http://semver.org) so you can control the risk associated with updating
139
-
your app. As an example, always downloading the latest minor version number (e.g. x.*y*.x) ensures
140
-
you get the latest security and feature enhanements but our API surface remains the same. You
141
-
can always see the latest version and release notes under the Releases tab of GitHub.
127
+
This library controls how users sign-in and access services. We recommend you always take the latest version of our library in your app when possible. We use [semantic versioning](http://semver.org) so you can control the risk associated with updating your app. As an example, always downloading the latest minor version number (e.g. x.*y*.x) ensures you get the latest security and feature enhanements but our API surface remains the same. You can always see the latest version and release notes under the Releases tab of GitHub.
142
128
143
129
## Security Reporting
144
130
145
-
If you find a security issue with our libraries or services please report it
submission may be eligible for a bounty through the [Microsoft Bounty](http://aka.ms/bugbounty)
148
-
program. Please do not post security issues to GitHub Issues or any other public site. We will
149
-
contact you shortly upon receiving the information. We encourage you to get notifications of when
150
-
security incidents occur by
151
-
visiting [this page](https://technet.microsoft.com/en-us/security/dd252948) and subscribing
152
-
to Security Advisory Alerts.
131
+
If you find a security issue with our libraries or services please report it to [[email protected]](mailto:[email protected]) with as much detail as possible. Your submission may be eligible for a bounty through the [Microsoft Bounty](http://aka.ms/bugbounty)
132
+
program. Please do not post security issues to GitHub Issues or any other public site. We will contact you shortly upon receiving the information. We encourage you to get notifications of when security incidents occur by visiting [this page](https://technet.microsoft.com/en-us/security/dd252948) and subscribing to Security Advisory Alerts.
153
133
154
134
Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License (the "License");
0 commit comments