|
Lines 86-101
AuthenticatorPresenterCoordinator::~AuthenticatorPresenterCoordinator()
a/Source/WebKit/UIProcess/WebAuthentication/Cocoa/AuthenticatorPresenterCoordinator.mm_sec1
|
| 86 |
m_laContextHandler(nullptr); |
86 |
m_laContextHandler(nullptr); |
| 87 |
if (m_responseHandler) |
87 |
if (m_responseHandler) |
| 88 |
m_responseHandler(nullptr); |
88 |
m_responseHandler(nullptr); |
|
|
89 |
if (m_pinHandler) |
| 90 |
m_pinHandler(String()); |
| 89 |
} |
91 |
} |
| 90 |
|
92 |
|
| 91 |
void AuthenticatorPresenterCoordinator::updatePresenter(WebAuthenticationStatus) |
93 |
void AuthenticatorPresenterCoordinator::updatePresenter(WebAuthenticationStatus status) |
| 92 |
{ |
94 |
{ |
| 93 |
// FIXME(219713): Adopt new UI for the update flow. |
95 |
#if HAVE(ASC_AUTH_UI) |
|
|
96 |
switch (status) { |
| 97 |
case WebAuthenticationStatus::PinBlocked: { |
| 98 |
auto error = adoptNS([[NSError alloc] initWithDomain:ASCAuthorizationErrorDomain code:ASCAuthorizationErrorPINRequired userInfo:@{ ASCPINValidationResultKey: @(ASCPINValidationResultPINBlocked) }]); |
| 99 |
m_credentialRequestHandler(nil, error.get()); |
| 100 |
break; |
| 101 |
} |
| 102 |
case WebAuthenticationStatus::PinAuthBlocked: { |
| 103 |
auto error = adoptNS([[NSError alloc] initWithDomain:ASCAuthorizationErrorDomain code:ASCAuthorizationErrorPINRequired userInfo:@{ ASCPINValidationResultKey: @(ASCPINValidationResultPINAuthBlocked) }]); |
| 104 |
m_credentialRequestHandler(nil, error.get()); |
| 105 |
break; |
| 106 |
} |
| 107 |
case WebAuthenticationStatus::PinInvalid: { |
| 108 |
auto error = adoptNS([[NSError alloc] initWithDomain:ASCAuthorizationErrorDomain code:ASCAuthorizationErrorPINRequired userInfo:@{ ASCPINValidationResultKey: @(ASCPINValidationResultPINInvalid) }]); |
| 109 |
m_credentialRequestHandler(nil, error.get()); |
| 110 |
break; |
| 111 |
} |
| 112 |
default: |
| 113 |
// FIXME(219713): Adopt new UI for the update flow. |
| 114 |
break; |
| 115 |
} |
| 116 |
#endif // HAVE(ASC_AUTH_UI) |
| 94 |
} |
117 |
} |
| 95 |
|
118 |
|
| 96 |
void AuthenticatorPresenterCoordinator::requestPin(uint64_t, CompletionHandler<void(const String&)>&&) |
119 |
void AuthenticatorPresenterCoordinator::requestPin(uint64_t, CompletionHandler<void(const String&)>&& completionHandler) |
| 97 |
{ |
120 |
{ |
| 98 |
// FIXME(219712): Adopt new UI for the Client PIN flow. |
121 |
#if HAVE(ASC_AUTH_UI) |
|
|
122 |
m_pinHandler = WTFMove(completionHandler); |
| 123 |
[m_presenter presentPINEntryInterface]; |
| 124 |
#endif // HAVE(ASC_AUTH_UI) |
| 99 |
} |
125 |
} |
| 100 |
|
126 |
|
| 101 |
void AuthenticatorPresenterCoordinator::selectAssertionResponse(Vector<Ref<AuthenticatorAssertionResponse>>&& responses, WebAuthenticationSource source, CompletionHandler<void(AuthenticatorAssertionResponse*)>&& completionHandler) |
127 |
void AuthenticatorPresenterCoordinator::selectAssertionResponse(Vector<Ref<AuthenticatorAssertionResponse>>&& responses, WebAuthenticationSource source, CompletionHandler<void(AuthenticatorAssertionResponse*)>&& completionHandler) |
|
Lines 156-166
void AuthenticatorPresenterCoordinator::requestLAContextForUserVerification(Comp
a/Source/WebKit/UIProcess/WebAuthentication/Cocoa/AuthenticatorPresenterCoordinator.mm_sec2
|
| 156 |
|
182 |
|
| 157 |
void AuthenticatorPresenterCoordinator::dimissPresenter(WebAuthenticationResult result) |
183 |
void AuthenticatorPresenterCoordinator::dimissPresenter(WebAuthenticationResult result) |
| 158 |
{ |
184 |
{ |
|
|
185 |
#if HAVE(ASC_AUTH_UI) |
| 159 |
if (result == WebAuthenticationResult::Succeeded && m_credentialRequestHandler) { |
186 |
if (result == WebAuthenticationResult::Succeeded && m_credentialRequestHandler) { |
| 160 |
m_credentialRequestHandler(); |
187 |
// FIXME(219767): Replace the ASCAppleIDCredential with the upcoming WebAuthn credentials one. |
|
|
188 |
// This is just a place holder to tell the UI that the ceremony succeeds. |
| 189 |
m_credentialRequestHandler(adoptNS([WebKit::allocASCAppleIDCredentialInstance() initWithUser:@"" identityToken:adoptNS([[NSData alloc] init]).get()]).get(), nil); |
| 161 |
return; |
190 |
return; |
| 162 |
} |
191 |
} |
| 163 |
// FIXME(219716): Adopt new UI for the dismiss flow. |
192 |
|
|
|
193 |
[m_presenter dismissWithError:nil]; |
| 194 |
#endif // HAVE(ASC_AUTH_UI) |
| 164 |
} |
195 |
} |
| 165 |
|
196 |
|
| 166 |
void AuthenticatorPresenterCoordinator::setLAContext(LAContext *context) |
197 |
void AuthenticatorPresenterCoordinator::setLAContext(LAContext *context) |
|
Lines 185-190
void AuthenticatorPresenterCoordinator::didSelectAssertionResponse(ASCLoginChoic
a/Source/WebKit/UIProcess/WebAuthentication/Cocoa/AuthenticatorPresenterCoordinator.mm_sec3
|
| 185 |
m_responseHandler(response.get()); |
216 |
m_responseHandler(response.get()); |
| 186 |
} |
217 |
} |
| 187 |
|
218 |
|
|
|
219 |
void AuthenticatorPresenterCoordinator::setPin(const String& pin) |
| 220 |
{ |
| 221 |
m_pinHandler(pin); |
| 222 |
} |
| 223 |
|
| 188 |
} // namespace WebKit |
224 |
} // namespace WebKit |
| 189 |
|
225 |
|
| 190 |
#endif // ENABLE(WEB_AUTHN) |
226 |
#endif // ENABLE(WEB_AUTHN) |