|
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 |
switch (status) { |
|
|
96 |
case WebAuthenticationStatus::PinBlocked: { |
| 97 |
auto error = adoptNS([[NSError alloc] initWithDomain:ASCAuthorizationErrorDomain code:ASCAuthorizationErrorPINRequired userInfo:@{ ASCPINValidationResultKey: @(ASCPINValidationResultPINBlocked) }]); |
| 98 |
m_credentialRequestHandler(nil, error.get()); |
| 99 |
break; |
| 100 |
} |
| 101 |
case WebAuthenticationStatus::PinAuthBlocked: { |
| 102 |
auto error = adoptNS([[NSError alloc] initWithDomain:ASCAuthorizationErrorDomain code:ASCAuthorizationErrorPINRequired userInfo:@{ ASCPINValidationResultKey: @(ASCPINValidationResultPINAuthBlocked) }]); |
| 103 |
m_credentialRequestHandler(nil, error.get()); |
| 104 |
break; |
| 105 |
} |
| 106 |
case WebAuthenticationStatus::PinInvalid: { |
| 107 |
auto error = adoptNS([[NSError alloc] initWithDomain:ASCAuthorizationErrorDomain code:ASCAuthorizationErrorPINRequired userInfo:@{ ASCPINValidationResultKey: @(ASCPINValidationResultPINInvalid) }]); |
| 108 |
m_credentialRequestHandler(nil, error.get()); |
| 109 |
break; |
| 110 |
} |
| 111 |
default: |
| 112 |
// FIXME(219713): Adopt new UI for the update flow. |
| 113 |
break; |
| 114 |
} |
| 94 |
} |
115 |
} |
| 95 |
|
116 |
|
| 96 |
void AuthenticatorPresenterCoordinator::requestPin(uint64_t, CompletionHandler<void(const String&)>&&) |
117 |
void AuthenticatorPresenterCoordinator::requestPin(uint64_t, CompletionHandler<void(const String&)>&& completionHandler) |
| 97 |
{ |
118 |
{ |
| 98 |
// FIXME(219712): Adopt new UI for the Client PIN flow. |
119 |
m_pinHandler = WTFMove(completionHandler); |
|
|
120 |
[m_presenter presentPINEntryInterface]; |
| 99 |
} |
121 |
} |
| 100 |
|
122 |
|
| 101 |
void AuthenticatorPresenterCoordinator::selectAssertionResponse(Vector<Ref<AuthenticatorAssertionResponse>>&& responses, WebAuthenticationSource source, CompletionHandler<void(AuthenticatorAssertionResponse*)>&& completionHandler) |
123 |
void AuthenticatorPresenterCoordinator::selectAssertionResponse(Vector<Ref<AuthenticatorAssertionResponse>>&& responses, WebAuthenticationSource source, CompletionHandler<void(AuthenticatorAssertionResponse*)>&& completionHandler) |
|
Lines 157-166
void AuthenticatorPresenterCoordinator::requestLAContextForUserVerification(Comp
a/Source/WebKit/UIProcess/WebAuthentication/Cocoa/AuthenticatorPresenterCoordinator.mm_sec2
|
| 157 |
void AuthenticatorPresenterCoordinator::dimissPresenter(WebAuthenticationResult result) |
179 |
void AuthenticatorPresenterCoordinator::dimissPresenter(WebAuthenticationResult result) |
| 158 |
{ |
180 |
{ |
| 159 |
if (result == WebAuthenticationResult::Succeeded && m_credentialRequestHandler) { |
181 |
if (result == WebAuthenticationResult::Succeeded && m_credentialRequestHandler) { |
| 160 |
m_credentialRequestHandler(); |
182 |
// FIXME(219767): Replace the ASCAppleIDCredential with the upcoming WebAuthn credentials one. |
|
|
183 |
// This is just a place holder to tell the UI that the ceremony succeeds. |
| 184 |
m_credentialRequestHandler(adoptNS([WebKit::allocASCAppleIDCredentialInstance() initWithUser:@"" identityToken:adoptNS([[NSData alloc] init]).get()]).get(), nil); |
| 161 |
return; |
185 |
return; |
| 162 |
} |
186 |
} |
| 163 |
// FIXME(219716): Adopt new UI for the dismiss flow. |
187 |
|
|
|
188 |
[m_presenter dismissWithError:nil]; |
| 164 |
} |
189 |
} |
| 165 |
|
190 |
|
| 166 |
void AuthenticatorPresenterCoordinator::setLAContext(LAContext *context) |
191 |
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()); |
210 |
m_responseHandler(response.get()); |
| 186 |
} |
211 |
} |
| 187 |
|
212 |
|
|
|
213 |
void AuthenticatorPresenterCoordinator::setPin(const String& pin) |
| 214 |
{ |
| 215 |
m_pinHandler(pin); |
| 216 |
} |
| 217 |
|
| 188 |
} // namespace WebKit |
218 |
} // namespace WebKit |
| 189 |
|
219 |
|
| 190 |
#endif // ENABLE(WEB_AUTHN) |
220 |
#endif // ENABLE(WEB_AUTHN) |