Changeset 272040 in webkit


Ignore:
Timestamp:
Jan 28, 2021 4:39:53 PM (3 years ago)
Author:
jiewen_tan@apple.com
Message:

[WebAuthn] Adopt new SPI to show no credentials error for the platform authenticator
https://bugs.webkit.org/show_bug.cgi?id=220894
<rdar://problem/73538568>

Reviewed by Brent Fulgham.

Covered by manual tests.

  • Platform/spi/Cocoa/AuthenticationServicesCoreSPI.h:
  • UIProcess/WebAuthentication/Cocoa/AuthenticatorPresenterCoordinator.mm:

(WebKit::AuthenticatorPresenterCoordinator::updatePresenter):

Location:
trunk/Source/WebKit
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r272039 r272040  
     12021-01-28  Jiewen Tan  <jiewen_tan@apple.com>
     2
     3        [WebAuthn] Adopt new SPI to show no credentials error for the platform authenticator
     4        https://bugs.webkit.org/show_bug.cgi?id=220894
     5        <rdar://problem/73538568>
     6
     7        Reviewed by Brent Fulgham.
     8
     9        Covered by manual tests.
     10
     11        * Platform/spi/Cocoa/AuthenticationServicesCoreSPI.h:
     12        * UIProcess/WebAuthentication/Cocoa/AuthenticatorPresenterCoordinator.mm:
     13        (WebKit::AuthenticatorPresenterCoordinator::updatePresenter):
     14
    1152021-01-28  Peng Liu  <peng.liu6@apple.com>
    216
  • trunk/Source/WebKit/Platform/spi/Cocoa/AuthenticationServicesCoreSPI.h

    r271613 r272040  
    7171
    7272- (void)presentAuthorizationWithContext:(ASCAuthorizationPresentationContext *)context completionHandler:(void (^)(id<ASCCredentialProtocol> _Nullable, NSError * _Nullable))completionHandler;
     73- (void)presentError:(NSError *)error forService:(NSString *)service completionHandler:(void (^)(void))completionHandler;
    7374- (void)updateInterfaceWithLoginChoices:(NSArray<id <ASCLoginChoiceProtocol>> *)loginChoices;
    7475- (void)presentPINEntryInterface;
  • trunk/Source/WebKit/UIProcess/WebAuthentication/Cocoa/AuthenticatorPresenterCoordinator.mm

    r271754 r272040  
    123123        break;
    124124    }
    125     case WebAuthenticationStatus::LANoCredential:
    126         if (m_delayedPresentationNeedsSecurityKey)
     125    case WebAuthenticationStatus::LANoCredential: {
     126        if (m_delayedPresentationNeedsSecurityKey) {
    127127            [m_context addLoginChoice:adoptNS([allocASCSecurityKeyPublicKeyCredentialLoginChoiceInstance() initAssertionPlaceholderChoice]).get()];
    128         m_delayedPresentation();
    129         break;
     128            m_delayedPresentation();
     129
     130            break;
     131        }
     132
     133        auto error = adoptNS([[NSError alloc] initWithDomain:ASCAuthorizationErrorDomain code:ASCAuthorizationErrorNoCredentialsFound userInfo:nil]);
     134        [m_presenter presentError:error.get() forService:[m_context serviceName] completionHandler:makeBlockPtr([manager = m_manager] {
     135            RunLoop::main().dispatch([manager] () mutable {
     136                if (manager)
     137                    manager->cancel();
     138            });
     139        }).get()];
     140        break;
     141    }
    130142    case WebAuthenticationStatus::NoCredentialsFound: {
    131143        auto error = adoptNS([[NSError alloc] initWithDomain:ASCAuthorizationErrorDomain code:ASCAuthorizationErrorNoCredentialsFound userInfo:nil]);
Note: See TracChangeset for help on using the changeset viewer.