Changeset 258442 in webkit
- Timestamp:
- Mar 13, 2020 4:15:31 PM (4 years ago)
- Location:
- trunk/Source
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r258434 r258442 1 2020-03-13 Jiewen Tan <jiewen_tan@apple.com> 2 3 [WebAuthn] Customize a bit more on the macOS LocalAuthentication prompt 4 https://bugs.webkit.org/show_bug.cgi?id=208703 5 <rdar://problem/60136974> 6 7 Reviewed by Darin Adler. 8 9 * en.lproj/Localizable.strings: 10 * platform/LocalizedStrings.cpp: 11 (WebCore::touchIDPromptTitle): 12 * platform/LocalizedStrings.h: 13 Adds a new formatted UI string to help with RP ID. 14 1 15 2020-03-13 Peng Liu <peng.liu6@apple.com> 2 16 -
trunk/Source/WebCore/en.lproj/Localizable.strings
r258092 r258442 887 887 "Touch ID to sign into this website." = "Touch ID to sign into this website."; 888 888 889 /* Allow using Touch ID to sign into the specified website on this device */ 890 "Touch ID to allow signing into “%@” with Touch ID." = "Touch ID to allow signing into “%@” with Touch ID."; 891 889 892 /* Transformations context sub-menu item */ 890 893 "Transformations" = "Transformations"; -
trunk/Source/WebCore/platform/LocalizedStrings.cpp
r257877 r258442 1209 1209 1210 1210 #if ENABLE(WEB_AUTHN) 1211 String touchIDPromptTitle()1211 String genericTouchIDPromptTitle() 1212 1212 { 1213 1213 return WEB_UI_STRING("Touch ID to sign into this website.", "Use Touch ID to sign into this website"); 1214 1214 } 1215 1215 1216 String makeCredentialTouchIDPromptTitle(const String& domain) 1217 { 1218 return formatLocalizedString(WEB_UI_CFSTRING("Touch ID to allow signing into “%@” with Touch ID.", "Allow using Touch ID to sign into the specified website on this device"), domain.createCFString().get()); 1219 } 1220 1216 1221 String biometricFallbackPromptTitle() 1217 1222 { -
trunk/Source/WebCore/platform/LocalizedStrings.h
r257877 r258442 341 341 342 342 #if ENABLE(WEB_AUTHN) 343 WEBCORE_EXPORT String touchIDPromptTitle(); 343 WEBCORE_EXPORT String genericTouchIDPromptTitle(); 344 WEBCORE_EXPORT String makeCredentialTouchIDPromptTitle(const String& domain); 344 345 WEBCORE_EXPORT String biometricFallbackPromptTitle(); 345 346 #endif -
trunk/Source/WebKit/ChangeLog
r258441 r258442 1 2020-03-13 Jiewen Tan <jiewen_tan@apple.com> 2 3 [WebAuthn] Customize a bit more on the macOS LocalAuthentication prompt 4 https://bugs.webkit.org/show_bug.cgi?id=208703 5 <rdar://problem/60136974> 6 7 Reviewed by Darin Adler. 8 9 On macOS, LocalAuthentication prompt can be shown anywhere that is probably not on top of 10 our UI clients. Therefore, add a RP ID to the dialog to help users to identify what has 11 happened. In addition, it removes the password fallback button. 12 13 * Platform/spi/Cocoa/LocalAuthenticationSPI.h: 14 * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm: 15 (WebKit::LocalAuthenticator::continueMakeCredentialAfterDecidePolicy): 16 (WebKit::LocalAuthenticator::continueGetAssertionAfterResponseSelected): 17 * UIProcess/WebAuthentication/Cocoa/LocalConnection.h: 18 * UIProcess/WebAuthentication/Cocoa/LocalConnection.mm: 19 (WebKit::LocalConnection::verifyUser const): 20 * UIProcess/WebAuthentication/Mock/MockLocalConnection.h: 21 * UIProcess/WebAuthentication/Mock/MockLocalConnection.mm: 22 (WebKit::MockLocalConnection::verifyUser const): 23 1 24 2020-03-13 Brent Fulgham <bfulgham@apple.com> 2 25 -
trunk/Source/WebKit/Platform/spi/Cocoa/LocalAuthenticationSPI.h
r257877 r258442 37 37 LAOptionAuthenticationTitle, 38 38 LAOptionPasscodeTitle, 39 LAOptionFallbackVisible, 39 40 }; 40 41 -
trunk/Source/WebKit/UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm
r258293 r258442 238 238 m_state = State::PolicyDecided; 239 239 240 auto& creationOptions = WTF::get<PublicKeyCredentialCreationOptions>(requestData().options); 241 240 242 if (policy == LocalAuthenticatorPolicy::Disallow) { 241 243 receiveRespond(ExceptionData { UnknownError, "Disallow local authenticator."_s }); … … 262 264 weakThis->continueMakeCredentialAfterUserVerification(accessControl.get(), verification, context); 263 265 }; 264 m_connection->verifyUser( accessControlRef, WTFMove(callback));266 m_connection->verifyUser(creationOptions.rp.id, accessControlRef, WTFMove(callback)); 265 267 } 266 268 … … 477 479 m_state = State::ResponseSelected; 478 480 481 auto& requestOptions = WTF::get<PublicKeyCredentialRequestOptions>(requestData().options); 482 479 483 auto accessControlRef = response->accessControl(); 480 484 auto callback = [ … … 488 492 weakThis->continueGetAssertionAfterUserVerification(WTFMove(response), verification, context); 489 493 }; 490 m_connection->verifyUser( accessControlRef, WTFMove(callback));494 m_connection->verifyUser(requestOptions.rpId, accessControlRef, WTFMove(callback)); 491 495 } 492 496 -
trunk/Source/WebKit/UIProcess/WebAuthentication/Cocoa/LocalConnection.h
r257877 r258442 63 63 64 64 // Overrided by MockLocalConnection. 65 virtual void verifyUser( SecAccessControlRef, UserVerificationCallback&&) const;65 virtual void verifyUser(const String& rpId, SecAccessControlRef, UserVerificationCallback&&) const; 66 66 virtual RetainPtr<SecKeyRef> createCredentialPrivateKey(LAContext *, SecAccessControlRef, const String& secAttrLabel, NSData *secAttrApplicationTag) const; 67 67 virtual void getAttestation(SecKeyRef, NSData *authData, NSData *hash, AttestationCallback&&) const; -
trunk/Source/WebKit/UIProcess/WebAuthentication/Cocoa/LocalConnection.mm
r257891 r258442 41 41 namespace WebKit { 42 42 43 void LocalConnection::verifyUser( SecAccessControlRef accessControl, UserVerificationCallback&& completionHandler) const43 void LocalConnection::verifyUser(const String& rpId, SecAccessControlRef accessControl, UserVerificationCallback&& completionHandler) const 44 44 { 45 45 auto context = adoptNS([allocLAContextInstance() init]); 46 46 47 47 auto options = adoptNS([[NSMutableDictionary alloc] init]); 48 if ([context biometryType] == LABiometryTypeTouchID) 49 [options setObject:WebCore::touchIDPromptTitle() forKey:@(LAOptionAuthenticationTitle)]; 50 #if PLATFORM(iOS) 48 if ([context biometryType] == LABiometryTypeTouchID) { 49 #if PLATFORM(IOS) 50 [options setObject:WebCore::genericTouchIDPromptTitle() forKey:@(LAOptionAuthenticationTitle)]; 51 ASSERT_UNUSED(rpId, rpId); 52 #else 53 [options setObject:WebCore::makeCredentialTouchIDPromptTitle(rpId) forKey:@(LAOptionAuthenticationTitle)]; 54 #endif 55 [options setObject:@NO forKey:@(LAOptionFallbackVisible)]; 56 } 57 #if PLATFORM(IOS) 51 58 [options setObject:WebCore::biometricFallbackPromptTitle() forKey:@(LAOptionPasscodeTitle)]; 52 59 #endif -
trunk/Source/WebKit/UIProcess/WebAuthentication/Mock/MockLocalConnection.h
r257877 r258442 38 38 39 39 private: 40 void verifyUser( SecAccessControlRef, UserVerificationCallback&&) const final;40 void verifyUser(const String&, SecAccessControlRef, UserVerificationCallback&&) const final; 41 41 RetainPtr<SecKeyRef> createCredentialPrivateKey(LAContext *, SecAccessControlRef, const String& secAttrLabel, NSData *secAttrApplicationTag) const final; 42 42 void getAttestation(SecKeyRef, NSData *authData, NSData *hash, AttestationCallback&&) const final; -
trunk/Source/WebKit/UIProcess/WebAuthentication/Mock/MockLocalConnection.mm
r258293 r258442 45 45 } 46 46 47 void MockLocalConnection::verifyUser( SecAccessControlRef, UserVerificationCallback&& callback) const47 void MockLocalConnection::verifyUser(const String&, SecAccessControlRef, UserVerificationCallback&& callback) const 48 48 { 49 49 // Mock async operations.
Note: See TracChangeset
for help on using the changeset viewer.