Skip to content

Commit c625e01

Browse files
committed
Merge branch 'develop'
2 parents 70082e7 + 453a9b7 commit c625e01

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+962
-456
lines changed

Profile Manifest/com.twocanoes.xcreds.plist

+150-21
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@
55
<key>pfm_app_url</key>
66
<string>https://github.com/twocanoes/xcreds</string>
77
<key>pfm_description</key>
8-
<string>xcreds OAuth Settings</string>
8+
<string>XCreds OAuth Settings</string>
9+
<key>pfm_documentation_url</key>
10+
<string>https://github.com/twocanoes/xcreds/wiki/AdminGuide</string>
911
<key>pfm_domain</key>
1012
<string>com.twocanoes.xcreds</string>
11-
<key>pfm_documentation_url</key>
12-
<string>https://github.com/twocanoes/xcreds</string>
1313
<key>pfm_platforms</key>
1414
<array>
1515
<string>macOS</string>
1616
</array>
1717
<key>pfm_format_version</key>
1818
<integer>1</integer>
1919
<key>pfm_last_modified</key>
20-
<date>2022-08-12T17:21:11Z</date>
20+
<date>2022-09-01T15:08:44Z</date>
2121
<key>pfm_subkeys</key>
2222
<array>
2323
<dict>
@@ -132,12 +132,12 @@ A profile can consist of payloads with different version numbers. For example, c
132132
<string>https://github.com/twocanoes/xcreds/wiki/AdminGuide#clientid</string>
133133
<key>pfm_name</key>
134134
<string>clientID</string>
135+
<key>pfm_require</key>
136+
<string>always</string>
135137
<key>pfm_title</key>
136138
<string>Client ID</string>
137139
<key>pfm_type</key>
138140
<string>string</string>
139-
<key>pfm_require</key>
140-
<string>always</string>
141141
</dict>
142142
<dict>
143143
<key>pfm_description</key>
@@ -160,26 +160,26 @@ A profile can consist of payloads with different version numbers. For example, c
160160
<string>https://github.com/twocanoes/xcreds/wiki/AdminGuide#createadminuser</string>
161161
<key>pfm_name</key>
162162
<string>CreateAdminUser</string>
163-
<key>pfm_type</key>
164-
<string>boolean</string>
165163
<key>pfm_title</key>
166164
<string>Create User as Admin</string>
165+
<key>pfm_type</key>
166+
<string>boolean</string>
167167
</dict>
168168
<dict>
169+
<key>pfm_default</key>
170+
<string>https://login.microsoftonline.com/common/.well-known/openid-configuration</string>
169171
<key>pfm_description</key>
170172
<string>The discovery URL provided by your OIDC / Cloud provider.</string>
171173
<key>pfm_documentation_url</key>
172174
<string>https://github.com/twocanoes/xcreds/wiki/AdminGuide#discoveryurl</string>
173-
<key>pfm_default</key>
174-
<string>https://login.microsoftonline.com/common/.well-known/openid-configuration</string>
175175
<key>pfm_name</key>
176176
<string>discoveryURL</string>
177177
<key>pfm_require</key>
178178
<string>always</string>
179-
<key>pfm_type</key>
180-
<string>string</string>
181179
<key>pfm_title</key>
182180
<string>Discovery URL</string>
181+
<key>pfm_type</key>
182+
<string>string</string>
183183
</dict>
184184
<dict>
185185
<key>pfm_default</key>
@@ -199,7 +199,7 @@ A profile can consist of payloads with different version numbers. For example, c
199199
<key>pfm_default</key>
200200
<false/>
201201
<key>pfm_description</key>
202-
<string>Save the Personal Recovery Key (PRK) to disk for the MDM Escrow Service to collect</string>
202+
<string>Save the Personal Recovery Key (PRK) to disk for the MDM Escrow Service to collect.</string>
203203
<key>pfm_documentation_url</key>
204204
<string>https://github.com/twocanoes/xcreds/wiki/AdminGuide#enablefderecoverykey</string>
205205
<key>pfm_name</key>
@@ -211,7 +211,9 @@ A profile can consist of payloads with different version numbers. For example, c
211211
</dict>
212212
<dict>
213213
<key>pfm_description</key>
214-
<string>Specify a custom path for the recovery key</string>
214+
<string>Specify a custom path for the recovery key.</string>
215+
<key>pfm_documentation_url</key>
216+
<string>https://github.com/twocanoes/xcreds/wiki/AdminGuide#enablefderecoverykeypath</string>
215217
<key>pfm_name</key>
216218
<string>EnableFDERecoveryKeyPath</string>
217219
<key>pfm_title</key>
@@ -223,7 +225,7 @@ A profile can consist of payloads with different version numbers. For example, c
223225
<key>pfm_default</key>
224226
<false/>
225227
<key>pfm_description</key>
226-
<string>Rotate the Personal Recovery Key (PRK)</string>
228+
<string>Rotate the Personal Recovery Key (PRK).</string>
227229
<key>pfm_documentation_url</key>
228230
<string>https://github.com/twocanoes/xcreds/wiki/AdminGuide#enablefderekey</string>
229231
<key>pfm_name</key>
@@ -237,9 +239,11 @@ A profile can consist of payloads with different version numbers. For example, c
237239
<key>pfm_default</key>
238240
<string>file:///System/Library/Desktop Pictures/Monterey Graphic.heic</string>
239241
<key>pfm_description</key>
240-
<string>url to an image to show in the background while logging in </string>
242+
<string>URL to an image to show in the background while logging in.</string>
241243
<key>pfm_documentation_url</key>
242244
<string>https://github.com/twocanoes/xcreds/wiki/AdminGuide#loginwindowbackgroundimageurl</string>
245+
<key>pfm_format</key>
246+
<string>(https?://|file:///).*</string>
243247
<key>pfm_name</key>
244248
<string>loginWindowBackgroundImageURL</string>
245249
<key>pfm_title</key>
@@ -252,6 +256,8 @@ A profile can consist of payloads with different version numbers. For example, c
252256
<string>Add a menu item for changing the password that will open this URL when the menu item is selected.</string>
253257
<key>pfm_documentation_url</key>
254258
<string>https://github.com/twocanoes/xcreds/wiki/AdminGuide#passwordchangeurl</string>
259+
<key>pfm_format</key>
260+
<string>https?://.*</string>
255261
<key>pfm_name</key>
256262
<string>passwordChangeURL</string>
257263
<key>pfm_title</key>
@@ -277,7 +283,7 @@ A profile can consist of payloads with different version numbers. For example, c
277283
<key>pfm_default</key>
278284
<integer>3</integer>
279285
<key>pfm_description</key>
280-
<string>Number of hours for checking for password changes. Default is 3 hours. Minimum is 1 hour.</string>
286+
<string>Number of hours for checking for password changes. Default is 3 hours. Minimum is 1 hour.</string>
281287
<key>pfm_documentation_url</key>
282288
<string>https://github.com/twocanoes/xcreds/wiki/AdminGuide#refreshratehours</string>
283289
<key>pfm_name</key>
@@ -302,6 +308,8 @@ A profile can consist of payloads with different version numbers. For example, c
302308
<string>https://github.com/twocanoes/xcreds/wiki/AdminGuide#scopes</string>
303309
<key>pfm_name</key>
304310
<string>scopes</string>
311+
<key>pfm_note</key>
312+
<string>All scopes should be lowercase and separated by single spaces</string>
305313
<key>pfm_title</key>
306314
<string>Scopes</string>
307315
<key>pfm_type</key>
@@ -321,6 +329,20 @@ A profile can consist of payloads with different version numbers. For example, c
321329
<key>pfm_type</key>
322330
<string>boolean</string>
323331
</dict>
332+
<dict>
333+
<key>pfm_default</key>
334+
<true/>
335+
<key>pfm_description</key>
336+
<string>Determine if the mac login window or the cloud login window is shown by default</string>
337+
<key>pfm_documentation_url</key>
338+
<string>https://github.com/twocanoes/xcreds/wiki/AdminGuide#shouldshowcloudloginbydefault</string>
339+
<key>pfm_name</key>
340+
<string>shouldShowCloudLoginByDefault</string>
341+
<key>pfm_title</key>
342+
<string>Show Cloud Login By Default</string>
343+
<key>pfm_type</key>
344+
<string>boolean</string>
345+
</dict>
324346
<dict>
325347
<key>pfm_default</key>
326348
<true/>
@@ -336,10 +358,10 @@ A profile can consist of payloads with different version numbers. For example, c
336358
<string>boolean</string>
337359
</dict>
338360
<dict>
339-
<key>pfm_description</key>
340-
<string>Show Configure WiFi button in XCreds Login.</string>
341361
<key>pfm_default</key>
342362
<true/>
363+
<key>pfm_description</key>
364+
<string>Show Configure WiFi button in XCreds Login.</string>
343365
<key>pfm_documentation_url</key>
344366
<string>https://github.com/twocanoes/xcreds/wiki/AdminGuide#shouldshowconfigurewifibutton</string>
345367
<key>pfm_name</key>
@@ -353,7 +375,7 @@ A profile can consist of payloads with different version numbers. For example, c
353375
<key>pfm_default</key>
354376
<false/>
355377
<key>pfm_description</key>
356-
<string>If no settings are specified, preferences will not be shown on startupu</string>
378+
<string>If no settings are specified, preferences will not be shown on startup.</string>
357379
<key>pfm_documentation_url</key>
358380
<string>https://github.com/twocanoes/xcreds/wiki/AdminGuide#shouldshowpreferencesonstart</string>
359381
<key>pfm_name</key>
@@ -459,6 +481,113 @@ A profile can consist of payloads with different version numbers. For example, c
459481
<key>pfm_type</key>
460482
<string>boolean</string>
461483
</dict>
484+
<dict>
485+
<key>pfm_description</key>
486+
<string>hostname of the page that has the password field.</string>
487+
<key>pfm_documentation_url</key>
488+
<string>https://github.com/twocanoes/xcreds/wiki/AdminGuide#idphostname</string>
489+
<key>pfm_name</key>
490+
<string>idpHostName</string>
491+
<key>pfm_title</key>
492+
<string>idpHostName</string>
493+
<key>pfm_type</key>
494+
<string>string</string>
495+
</dict>
496+
<dict>
497+
<key>pfm_description</key>
498+
<string>array of hostnames of the page that has the password field.</string>
499+
<key>pfm_name</key>
500+
<string>idpHostNames</string>
501+
<key>pfm_subkeys</key>
502+
<array>
503+
<dict>
504+
<key>pfm_name</key>
505+
<string>idpHostName</string>
506+
<key>pfm_type</key>
507+
<string>string</string>
508+
</dict>
509+
</array>
510+
<key>pfm_title</key>
511+
<string>idpHostNames</string>
512+
<key>pfm_type</key>
513+
<string>array</string>
514+
</dict>
515+
<dict>
516+
<key>pfm_description</key>
517+
<string>password element id of the html element that has the password.</string>
518+
<key>pfm_documentation_url</key>
519+
<string>https://github.com/twocanoes/xcreds/wiki/AdminGuide#passwordelementid</string>
520+
<key>pfm_name</key>
521+
<string>passwordElementID</string>
522+
<key>pfm_title</key>
523+
<string>passwordElementID</string>
524+
<key>pfm_type</key>
525+
<string>string</string>
526+
</dict>
527+
<dict>
528+
<key>pfm_default</key>
529+
<string>given_name</string>
530+
<key>pfm_description</key>
531+
<string>Local DS to OIDC Mapping for First Name</string>
532+
<key>pfm_documentation_url</key>
533+
<string>https://github.com/twocanoes/xcreds/wiki/AdminGuide#oidcmappingfirstname</string>
534+
<key>pfm_name</key>
535+
<string>map_firstname</string>
536+
<key>pfm_note</key>
537+
<string>Map firstName to OIDC claim</string>
538+
<key>pfm_title</key>
539+
<string>First Name OIDC Mapping</string>
540+
<key>pfm_type</key>
541+
<string>string</string>
542+
</dict>
543+
<dict>
544+
<key>pfm_default</key>
545+
<string>family_name</string>
546+
<key>pfm_description</key>
547+
<string>Local DS to OIDC Mapping for Last Name</string>
548+
<key>pfm_documentation_url</key>
549+
<string>https://github.com/twocanoes/xcreds/wiki/AdminGuide#oidcmappinglastname</string>
550+
<key>pfm_name</key>
551+
<string>map_lastname</string>
552+
<key>pfm_note</key>
553+
<string>Map lastName to OIDC claim</string>
554+
<key>pfm_title</key>
555+
<string>Last Name OIDC Mapping</string>
556+
<key>pfm_type</key>
557+
<string>string</string>
558+
</dict>
559+
<dict>
560+
<key>pfm_default</key>
561+
<string>name</string>
562+
<key>pfm_description</key>
563+
<string>Local DS to OIDC Mapping for Name</string>
564+
<key>pfm_documentation_url</key>
565+
<string>https://github.com/twocanoes/xcreds/wiki/AdminGuide#oidcmappingfullname</string>
566+
<key>pfm_name</key>
567+
<string>map_fullname</string>
568+
<key>pfm_note</key>
569+
<string>Map fullName to OIDC claim</string>
570+
<key>pfm_title</key>
571+
<string>Full Name OIDC Mapping</string>
572+
<key>pfm_type</key>
573+
<string>string</string>
574+
</dict>
575+
<dict>
576+
<key>pfm_default</key>
577+
<string>name</string>
578+
<key>pfm_description</key>
579+
<string>Local DS to OIDC Mapping for Name</string>
580+
<key>pfm_documentation_url</key>
581+
<string>https://github.com/twocanoes/xcreds/wiki/AdminGuide#oidcmappinglusername</string>
582+
<key>pfm_name</key>
583+
<string>map_username</string>
584+
<key>pfm_note</key>
585+
<string>Map Username to OIDC claim</string>
586+
<key>pfm_title</key>
587+
<string>Username OIDC Mapping</string>
588+
<key>pfm_type</key>
589+
<string>string</string>
590+
</dict>
462591
</array>
463592
<key>pfm_targets</key>
464593
<array>
@@ -470,6 +599,6 @@ A profile can consist of payloads with different version numbers. For example, c
470599
<key>pfm_unique</key>
471600
<false/>
472601
<key>pfm_version</key>
473-
<integer>1</integer>
602+
<integer>2</integer>
474603
</dict>
475604
</plist>

Sample Profile/xcreds_example_azure.mobileconfig

+8
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,14 @@
2929
<string>profile openid email offline_access</string>
3030
<key>shouldShowQuitMenu</key>
3131
<false/>
32+
<key>map_firstname</key>
33+
<string>given_name</string>
34+
<key>map_fullname</key>
35+
<string>name</string>
36+
<key>map_lastname</key>
37+
<string>family_name</string>
38+
<key>map_username</key>
39+
<string>name</string>
3240
</dict>
3341
</array>
3442
<key>PayloadDescription</key>

Sample Profile/xcreds_example_google.mobileconfig

+8
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@
3131
<string>profile openid email</string>
3232
<key>shouldSetGoogleAccessTypeToOffline</key>
3333
<true/>
34+
<key>map_firstname</key>
35+
<string>given_name</string>
36+
<key>map_fullname</key>
37+
<string>name</string>
38+
<key>map_lastname</key>
39+
<string>family_name</string>
40+
<key>map_username</key>
41+
<string>name</string>
3442
</dict>
3543
</array>
3644
<key>PayloadDescription</key>

Shared/Tokens.swift

+28-4
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,34 @@
66
//
77

88
import Foundation
9-
struct Tokens {
9+
import OIDCLite
10+
struct Creds {
1011
var password = ""
11-
var accessToken = ""
12-
var idToken = ""
13-
var refreshToken = ""
12+
public var accessToken: String?
13+
public var idToken: String?
14+
public var refreshToken: String?
15+
public var jsonDict: [String:Any]?
16+
17+
init(password:String, tokens:OIDCLiteTokenResponse) {
18+
19+
self.accessToken=tokens.accessToken
20+
self.idToken=tokens.idToken
21+
self.refreshToken=tokens.refreshToken
22+
self.password=password
23+
self.jsonDict=tokens.jsonDict
24+
25+
}
26+
init(accessToken:String?, idToken:String?,refreshToken:String?, password:String?,jsonDict:Dictionary <String,Any>,pass:String) {
27+
28+
self.accessToken=accessToken
29+
self.idToken=idToken
30+
self.refreshToken=refreshToken
31+
self.password=pass
32+
self.jsonDict=jsonDict
33+
34+
}
35+
1436
}
1537

38+
39+

0 commit comments

Comments
 (0)