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
{{ message }}
This repository was archived by the owner on Jun 10, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+18-18Lines changed: 18 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,32 +24,32 @@ The MSAL library for iOS and macOS gives your app the ability to begin using the
24
24
## Example
25
25
26
26
```swift
27
-
do {
28
-
// Create an instance of MSALPublicClientApplication with proper config
29
-
let authority =tryMSALB2CAuthority(url: URL(string: "<your-authority-here>")!)
30
-
let pcaConfig =MSALPublicClientApplicationConfig(clientId: "<your-client-id-here>", redirectUri: nil, authority: authority)
31
-
let application =tryMSALPublicClientApplication(configuration: pcaConfig)
27
+
do {
28
+
// Create an instance of MSALPublicClientApplication with proper config
29
+
let authority =tryMSALB2CAuthority(url: URL(string: "<your-authority-here>")!)
30
+
let pcaConfig =MSALPublicClientApplicationConfig(clientId: "<your-client-id-here>", redirectUri: nil, authority: authority)
31
+
let application =tryMSALPublicClientApplication(configuration: pcaConfig)
32
32
33
-
let viewController =self/*replace with your main presentation controller here */
34
-
let webViewParameters =MSALWebviewParameters(parentViewController: viewController)
35
-
let interactiveParameters =MSALInteractiveTokenParameters(scopes: ["<enter-your-scope-here>"], webviewParameters: webViewParameters)
33
+
let viewController =self/*replace with your main presentation controller here */
34
+
let webViewParameters =MSALWebviewParameters(parentViewController: viewController)
35
+
let interactiveParameters =MSALInteractiveTokenParameters(scopes: ["<enter-your-scope-here>"], webviewParameters: webViewParameters)
36
36
37
-
application.acquireToken(with: interactiveParameters) { (result, error) in
37
+
application.acquireToken(with: interactiveParameters) { (result, error) in
38
38
39
-
guardlet result = result else {
40
-
print(error!) /* MSAL token acquisition failed, check error information */
41
-
return
39
+
guardlet result = result else {
40
+
print(error!) /* MSAL token acquisition failed, check error information */
41
+
return
42
42
}
43
43
44
44
let accessToken = result.accessToken
45
45
let account = result.account
46
46
/* MSAL token acquisition succeeded, use access token or check account */
47
47
48
-
}
49
-
}
50
-
catch {
51
-
print(error) /* MSALPublicClientApplication creation failed, check error information */
52
-
}
48
+
}
49
+
}
50
+
catch {
51
+
print(error) /* MSALPublicClientApplication creation failed, check error information */
52
+
}
53
53
```
54
54
55
55
## App Registration
@@ -141,4 +141,4 @@ This library controls how users sign-in and access services. We recommend you al
141
141
142
142
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) 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.
143
143
144
-
Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License (the "License");
144
+
Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License (the "License");
0 commit comments