Changeset 234912 in webkit


Ignore:
Timestamp:
Aug 15, 2018 10:38:39 PM (6 years ago)
Author:
commit-queue@webkit.org
Message:

NSURLAuthenticationMethodOAuth challenges are surfaced to clients in -didReceiveAuthenticationChallenge as NSURLAuthenticationMethodDefault
https://bugs.webkit.org/show_bug.cgi?id=186870
Source/WebCore:

<rdar://problem/41314410>

Patch by Ansh Shukla <ansh_shukla@apple.com> on 2018-08-15
Reviewed by Alex Christensen.

Add the ProtectionSpaceAuthenticationSchemeOAuth type.

  • platform/network/ProtectionSpaceBase.cpp:

(WebCore::ProtectionSpaceBase::isPasswordBased const): Return yes because the oauth challenge
expects a token in return.

  • platform/network/ProtectionSpaceBase.h:
  • platform/network/cocoa/ProtectionSpaceCocoa.mm:

(WebCore::scheme):
(WebCore::ProtectionSpace::nsSpace const):

Source/WebCore/PAL:

<rdar://problem/41314410>

Patch by Ansh Shukla <ansh_shukla@apple.com> on 2018-08-15
Reviewed by Alex Christensen.

  • pal/spi/cf/CFNetworkSPI.h: Declare OAuth string when not building against the

internal SDK.

Source/WebKit:

<rdar://problem/41314410>

Patch by Ansh Shukla <ansh_shukla@apple.com> on 2018-08-15
Reviewed by Alex Christensen.

Correctly expose the OAuth protection space type in API.

  • UIProcess/API/C/WKAPICast.h:

(WebKit::toAPI):

  • UIProcess/API/C/WKProtectionSpaceTypes.h:

Tools:

<rdar://problem/41314410>

Patch by Ansh Shukla <ansh_shukla@apple.com> on 2018-08-15
Reviewed by Alex Christensen.

  • WebKitTestRunner/TestController.cpp:

(WTR::toString):
(WTR::TestController::canAuthenticateAgainstProtectionSpace): Expose type of authentication challenge so we can test OAuth.
(WTR::TestController::didReceiveAuthenticationChallenge):

LayoutTests:

Patch by Ansh Shukla <ansh_shukla@apple.com> on 2018-08-15
Reviewed by Alex Christensen.

Ensure the exposed authentication type to clients is OAuth.

  • http/tests/loading/oauth-expected.txt: Added.
  • http/tests/loading/oauth.html: Added.
  • http/tests/loading/resources/oauth-subresource.php: Added.
Location:
trunk
Files:
4 added
37 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r234901 r234912  
     12018-08-15  Ansh Shukla  <ansh_shukla@apple.com>
     2
     3        NSURLAuthenticationMethodOAuth challenges are surfaced to clients in -didReceiveAuthenticationChallenge as NSURLAuthenticationMethodDefault
     4        https://bugs.webkit.org/show_bug.cgi?id=186870
     5
     6        Reviewed by Alex Christensen.
     7
     8        Ensure the exposed authentication type to clients is OAuth.
     9
     10        * http/tests/loading/oauth-expected.txt: Added.
     11        * http/tests/loading/oauth.html: Added.
     12        * http/tests/loading/resources/oauth-subresource.php: Added.
     13
    1142018-08-15  Christopher Reid  <chris.reid@sony.com>
    215
  • trunk/LayoutTests/http/tests/cache/disk-cache/speculative-validation/http-auth-expected.txt

    r234897 r234912  
    1 127.0.0.1:8000 - didReceiveAuthenticationChallenge - Responding with testUsername:testPassword
    2 127.0.0.1:8000 - didReceiveAuthenticationChallenge - Simulating cancelled authentication sheet
     1127.0.0.1:8000 - didReceiveAuthenticationChallenge - ProtectionSpaceAuthenticationSchemeHTTPBasic - Responding with testUsername:testPassword
     2127.0.0.1:8000 - didReceiveAuthenticationChallenge - ProtectionSpaceAuthenticationSchemeHTTPBasic - Simulating cancelled authentication sheet
    33Tests speculative revalidation of authenticated resources.
    44
  • trunk/LayoutTests/platform/mac-wk2/http/tests/inspector/network/resource-request-headers-expected.txt

    r234897 r234912  
    1 127.0.0.1:8000 - didReceiveAuthenticationChallenge - Simulating cancelled authentication sheet
    2 127.0.0.1:8000 - didReceiveAuthenticationChallenge - Simulating cancelled authentication sheet
     1127.0.0.1:8000 - didReceiveAuthenticationChallenge - ProtectionSpaceAuthenticationSchemeHTTPBasic - Simulating cancelled authentication sheet
     2127.0.0.1:8000 - didReceiveAuthenticationChallenge - ProtectionSpaceAuthenticationSchemeHTTPBasic - Simulating cancelled authentication sheet
    33Test for Resource request headers which may not have been immediately available but eventually are (Cookie, Authorization).
    44
  • trunk/LayoutTests/platform/wk2/http/tests/loading/authentication-after-redirect-stores-wrong-credentials/authentication-after-redirect-stores-wrong-credentials-expected.txt

    r234897 r234912  
    44frame "<!--frame1-->" - didStartProvisionalLoadForFrame
    55frame "<!--frame1-->" - didReceiveServerRedirectForProvisionalLoadForFrame
    6 127.0.0.1:8000 - didReceiveAuthenticationChallenge - Responding with httpUsername:httpPassword
     6127.0.0.1:8000 - didReceiveAuthenticationChallenge - ProtectionSpaceAuthenticationSchemeHTTPBasic - Responding with httpUsername:httpPassword
    77frame "<!--frame1-->" - didCommitLoadForFrame
    88frame "<!--frame1-->" - didFinishDocumentLoadForFrame
  • trunk/LayoutTests/platform/wk2/http/tests/loading/basic-auth-load-URL-with-consecutive-slashes-expected.txt

    r231456 r234912  
    33main frame - didFinishDocumentLoadForFrame
    44frame "<!--frame1-->" - didStartProvisionalLoadForFrame
    5 127.0.0.1:8000 - didReceiveAuthenticationChallenge - Responding with webkit:rocks
     5127.0.0.1:8000 - didReceiveAuthenticationChallenge - ProtectionSpaceAuthenticationSchemeHTTPBasic - Responding with webkit:rocks
    66frame "<!--frame1-->" - didCommitLoadForFrame
    77frame "<!--frame1-->" - didFinishDocumentLoadForFrame
  • trunk/LayoutTests/platform/wk2/http/tests/loading/basic-auth-resend-wrong-credentials-expected.txt

    r234897 r234912  
    55main frame - didFinishLoadForFrame
    66frame "<!--frame1-->" - didStartProvisionalLoadForFrame
    7 127.0.0.1:8000 - didReceiveAuthenticationChallenge - Responding with wrongusername:wrongpassword
     7127.0.0.1:8000 - didReceiveAuthenticationChallenge - ProtectionSpaceAuthenticationSchemeHTTPBasic - Responding with wrongusername:wrongpassword
    88frame "<!--frame1-->" - didCommitLoadForFrame
    99frame "<!--frame1-->" - didFinishDocumentLoadForFrame
     
    1111frame "<!--frame1-->" - didFinishLoadForFrame
    1212frame "<!--frame2-->" - didStartProvisionalLoadForFrame
    13 127.0.0.1:8000 - didReceiveAuthenticationChallenge - Responding with correctusername:correctpassword
     13127.0.0.1:8000 - didReceiveAuthenticationChallenge - ProtectionSpaceAuthenticationSchemeHTTPBasic - Responding with correctusername:correctpassword
    1414frame "<!--frame2-->" - didCommitLoadForFrame
    1515frame "<!--frame2-->" - didFinishDocumentLoadForFrame
  • trunk/LayoutTests/platform/wk2/http/tests/loading/basic-credentials-sent-automatically-expected.txt

    r234897 r234912  
    55main frame - didFinishLoadForFrame
    66frame "<!--frame1-->" - didStartProvisionalLoadForFrame
    7 127.0.0.1:8000 - didReceiveAuthenticationChallenge - Responding with first:first-pw
     7127.0.0.1:8000 - didReceiveAuthenticationChallenge - ProtectionSpaceAuthenticationSchemeHTTPBasic - Responding with first:first-pw
    88frame "<!--frame1-->" - didCommitLoadForFrame
    99frame "<!--frame1-->" - didFinishDocumentLoadForFrame
     
    1111frame "<!--frame1-->" - didFinishLoadForFrame
    1212frame "<!--frame2-->" - didStartProvisionalLoadForFrame
    13 127.0.0.1:8000 - didReceiveAuthenticationChallenge - Responding with second:second-pw
     13127.0.0.1:8000 - didReceiveAuthenticationChallenge - ProtectionSpaceAuthenticationSchemeHTTPBasic - Responding with second:second-pw
    1414frame "<!--frame2-->" - didCommitLoadForFrame
    1515frame "<!--frame2-->" - didFinishDocumentLoadForFrame
  • trunk/LayoutTests/platform/wk2/http/tests/media/video-auth-expected.txt

    r234897 r234912  
    1 127.0.0.1:8000 - didReceiveAuthenticationChallenge - Responding with username:password
     1127.0.0.1:8000 - didReceiveAuthenticationChallenge - ProtectionSpaceAuthenticationSchemeHTTPBasic - Responding with username:password
    22 
    33Tests that the media player sends authorization credentials when requesting a media file.
  • trunk/LayoutTests/platform/wk2/http/tests/media/video-auth-with-allowCrossOriginSubresourcesToAskForCredentials-expected.txt

    r234897 r234912  
    1 127.0.0.1:8000 - didReceiveAuthenticationChallenge - Responding with username:password
    2 localhost:8000 - didReceiveAuthenticationChallenge - Responding with username:password
     1127.0.0.1:8000 - didReceiveAuthenticationChallenge - ProtectionSpaceAuthenticationSchemeHTTPBasic - Responding with username:password
     2localhost:8000 - didReceiveAuthenticationChallenge - ProtectionSpaceAuthenticationSchemeHTTPBasic - Responding with username:password
    33 
    44Tests that the media player sends authorization credentials when requesting a media file.
  • trunk/LayoutTests/platform/wk2/http/tests/misc/401-alternative-content-expected.txt

    r234897 r234912  
    1 127.0.0.1:8000 - didReceiveAuthenticationChallenge - Simulating cancelled authentication sheet
     1127.0.0.1:8000 - didReceiveAuthenticationChallenge - ProtectionSpaceAuthenticationSchemeHTTPBasic - Simulating cancelled authentication sheet
    22PASS
  • trunk/LayoutTests/platform/wk2/http/tests/misc/authentication-redirect-1/authentication-sent-to-redirect-cross-origin-expected.txt

    r234897 r234912  
    1 localhost:8000 - didReceiveAuthenticationChallenge - Responding with testUser:testPassword
     1localhost:8000 - didReceiveAuthenticationChallenge - ProtectionSpaceAuthenticationSchemeHTTPBasic - Responding with testUser:testPassword
    22https://bugs.webkit.org/show_bug.cgi?id=40138
    33You should load this page at 127.0.0.1:8000 so localhost:8000 is considered a different security origin.
  • trunk/LayoutTests/platform/wk2/http/tests/misc/authentication-redirect-2/authentication-sent-to-redirect-same-origin-expected.txt

    r234897 r234912  
    1 127.0.0.1:8000 - didReceiveAuthenticationChallenge - Responding with testUser:testPassword
     1127.0.0.1:8000 - didReceiveAuthenticationChallenge - ProtectionSpaceAuthenticationSchemeHTTPBasic - Responding with testUser:testPassword
    22https://bugs.webkit.org/show_bug.cgi?id=66354
    33You should load this page at 127.0.0.1:8000 because the test relies on redirects within the 127.0.0.1:8000 security origin.
  • trunk/LayoutTests/platform/wk2/http/tests/misc/authentication-redirect-3/authentication-sent-to-redirect-same-origin-with-location-credentials-expected.txt

    r234897 r234912  
    1 127.0.0.1:8000 - didReceiveAuthenticationChallenge - Responding with testUser:testPassword
     1127.0.0.1:8000 - didReceiveAuthenticationChallenge - ProtectionSpaceAuthenticationSchemeHTTPBasic - Responding with testUser:testPassword
    22https://bugs.webkit.org/show_bug.cgi?id=66354
    33You should load this page at 127.0.0.1:8000 because the test relies on redirects within the 127.0.0.1:8000 security origin.
  • trunk/LayoutTests/platform/wk2/http/tests/misc/authentication-redirect-4/authentication-sent-to-redirect-same-origin-url-expected.txt

    r234897 r234912  
    1 127.0.0.1:8000 - didReceiveAuthenticationChallenge - Responding with testUser:testPassword
     1127.0.0.1:8000 - didReceiveAuthenticationChallenge - ProtectionSpaceAuthenticationSchemeHTTPBasic - Responding with testUser:testPassword
    22https://bugs.webkit.org/show_bug.cgi?id=105190
    33You should load this page at 127.0.0.1:8000 because the test relies on redirects within the 127.0.0.1:8000 security origin.
  • trunk/LayoutTests/platform/wk2/http/tests/security/401-logout/401-logout-expected.txt

    r234897 r234912  
    1 127.0.0.1:8000 - didReceiveAuthenticationChallenge - Responding with username:password
    2 127.0.0.1:8000 - didReceiveAuthenticationChallenge - Simulating cancelled authentication sheet
     1127.0.0.1:8000 - didReceiveAuthenticationChallenge - ProtectionSpaceAuthenticationSchemeHTTPBasic - Responding with username:password
     2127.0.0.1:8000 - didReceiveAuthenticationChallenge - ProtectionSpaceAuthenticationSchemeHTTPBasic - Simulating cancelled authentication sheet
    33PASS
  • trunk/LayoutTests/platform/wk2/http/tests/security/basic-auth-subresource-expected.txt

    r234897 r234912  
    1 127.0.0.1:8000 - didReceiveAuthenticationChallenge - Responding with testUser:testPassword
     1127.0.0.1:8000 - didReceiveAuthenticationChallenge - ProtectionSpaceAuthenticationSchemeHTTPBasic - Responding with testUser:testPassword
    22CONSOLE MESSAGE: Blocked http://localhost:8000/security/resources/subresource1/protected-image.php from asking for credentials because it is a cross-origin request.
    33CONSOLE MESSAGE: Blocked https://localhost:8443/security/resources/subresource1/protected-image.php from asking for credentials because it is a cross-origin request.
    44CONSOLE MESSAGE: Blocked http://localhost:8000/security/resources/subresource2/protected-image.php from asking for credentials because it is a cross-origin request.
    5 127.0.0.1:8000 - didReceiveAuthenticationChallenge - Responding with testUser:testPassword
     5127.0.0.1:8000 - didReceiveAuthenticationChallenge - ProtectionSpaceAuthenticationSchemeHTTPBasic - Responding with testUser:testPassword
    66CONSOLE MESSAGE: Blocked https://127.0.0.1:8443/security/resources/subresource2/protected-image.php from asking for credentials because it is a cross-origin request.
    77CONSOLE MESSAGE: Blocked https://localhost:8443/security/resources/subresource2/protected-image.php from asking for credentials because it is a cross-origin request.
  • trunk/LayoutTests/platform/wk2/http/tests/security/credentials-iframes-allowCrossOriginSubresourcesToAskForCredentials-expected.txt

    r234897 r234912  
    11ALERT: parent host: 127.0.0.1 iframe host: 127.0.0.1 credentials:User: same-domain-user, password: same-domain-password.
    2 127.0.0.1:8000 - didReceiveAuthenticationChallenge - Simulating cancelled authentication sheet
     2127.0.0.1:8000 - didReceiveAuthenticationChallenge - ProtectionSpaceAuthenticationSchemeHTTPBasic - Simulating cancelled authentication sheet
    33ALERT: parent host: localhost iframe host: 127.0.0.1 credentials:Authentication canceled
    44
  • trunk/LayoutTests/platform/wk2/http/tests/security/mixedContent/insecure-basic-auth-image-allowCrossOriginSubresourcesToAskForCredentials.https-expected.txt

    r234897 r234912  
    11CONSOLE MESSAGE: line 33: The page at https://127.0.0.1:8443/security/mixedContent/insecure-basic-auth-image-allowCrossOriginSubresourcesToAskForCredentials.https.html was allowed to display insecure content from http://localhost:8000/security/mixedContent/resources/subresource2/protected-image.php.
    22
    3 localhost:8000 - didReceiveAuthenticationChallenge - Responding with testUser:testPassword
     3localhost:8000 - didReceiveAuthenticationChallenge - ProtectionSpaceAuthenticationSchemeHTTPBasic - Responding with testUser:testPassword
    44Tests that we do not ask for credentials when loading an insecure image that requires basic authentication.
    55
  • trunk/LayoutTests/platform/wk2/http/tests/security/mixedContent/insecure-image-redirects-to-basic-auth-secure-image-allowCrossOriginSubresourcesToAskForCredentials-expected.txt

    r234897 r234912  
    11CONSOLE MESSAGE: line 18: The page at https://127.0.0.1:8443/security/mixedContent/resources/frame-with-insecure-image-redirects-to-basic-auth-secure-image.html?allowCrossOriginSubresourcesToAskForCredentials=1 was allowed to display insecure content from http://127.0.0.1:8080/resources/redirect.php?url=https://localhost:8443/security/mixedContent/resources/subresource/protected-image.php.
    22
    3 localhost:8443 - didReceiveAuthenticationChallenge - Responding with testUser:testPassword
     3localhost:8443 - didReceiveAuthenticationChallenge - ProtectionSpaceAuthenticationSchemeHTTPBasic - Responding with testUser:testPassword
    44This test opens a new window to a secure page that loads an insecure image that redirects to a secure image guarded by basic authentication. The image should load.
    55
  • trunk/LayoutTests/platform/wk2/http/tests/security/mixedContent/secure-page-navigates-to-basic-auth-insecure-page.https-expected.txt

    r234897 r234912  
    1 127.0.0.1:8000 - didReceiveAuthenticationChallenge - Responding with testUser:testPassword
     1127.0.0.1:8000 - didReceiveAuthenticationChallenge - ProtectionSpaceAuthenticationSchemeHTTPBasic - Responding with testUser:testPassword
    22Authenticated with username testUser.
  • trunk/LayoutTests/platform/wk2/http/tests/security/mixedContent/secure-page-navigates-to-basic-auth-secure-page-via-insecure-redirect.https-expected.txt

    r234897 r234912  
    1 127.0.0.1:8443 - didReceiveAuthenticationChallenge - Responding with testUser:testPassword
     1127.0.0.1:8443 - didReceiveAuthenticationChallenge - ProtectionSpaceAuthenticationSchemeHTTPBasic - Responding with testUser:testPassword
    22Authenticated with username testUser.
  • trunk/LayoutTests/platform/wk2/http/tests/security/mixedContent/secure-redirect-to-insecure-redirect-to-basic-auth-secure-image-allowCrossOriginSubresourcesToAskForCredentials.https-expected.txt

    r234897 r234912  
    11CONSOLE MESSAGE: The page at https://127.0.0.1:8443/security/mixedContent/secure-redirect-to-insecure-redirect-to-basic-auth-secure-image-allowCrossOriginSubresourcesToAskForCredentials.https.html was allowed to display insecure content from http://127.0.0.1:8080/resources/redirect.php?url=https://localhost:8443/security/mixedContent/resources/subresource/protected-image.php.
    22
    3 localhost:8443 - didReceiveAuthenticationChallenge - Responding with testUser:testPassword
     3localhost:8443 - didReceiveAuthenticationChallenge - ProtectionSpaceAuthenticationSchemeHTTPBasic - Responding with testUser:testPassword
    44This test loads a secure image that redirects to an insecure image that redirects to a secure image guarded by basic authentication. The image should load.
    55
  • trunk/LayoutTests/platform/wk2/http/tests/security/mixedContent/secure-redirect-to-secure-redirect-to-basic-auth-insecure-image-allowCrossOriginSubresourcesToAskForCredentials.https-expected.txt

    r234897 r234912  
    11CONSOLE MESSAGE: The page at https://127.0.0.1:8443/security/mixedContent/secure-redirect-to-secure-redirect-to-basic-auth-insecure-image-allowCrossOriginSubresourcesToAskForCredentials.https.html was allowed to display insecure content from http://localhost:8080/security/mixedContent/resources/subresource/protected-image.php.
    22
    3 localhost:8080 - didReceiveAuthenticationChallenge - Responding with testUser:testPassword
     3localhost:8080 - didReceiveAuthenticationChallenge - ProtectionSpaceAuthenticationSchemeHTTPBasic - Responding with testUser:testPassword
    44This test loads a secure image that redirects to an secure image that redirects to an insecure image guarded by basic authentication. The image should load.
    55
  • trunk/LayoutTests/platform/wk2/http/tests/security/mixedContent/secure-redirect-to-secure-redirect-to-basic-auth-secure-image-allowCrossOriginSubresourcesToAskForCredentials.https-expected.txt

    r234897 r234912  
    1 localhost:8443 - didReceiveAuthenticationChallenge - Responding with testUser:testPassword
     1localhost:8443 - didReceiveAuthenticationChallenge - ProtectionSpaceAuthenticationSchemeHTTPBasic - Responding with testUser:testPassword
    22This test loads a secure image that redirects to a secure image that redirects to a secure image guarded by basic authentication. The secure image should load.
    33
  • trunk/LayoutTests/platform/wk2/http/tests/xmlhttprequest/failed-auth-expected.txt

    r234897 r234912  
    1 127.0.0.1:8000 - didReceiveAuthenticationChallenge - Simulating cancelled authentication sheet
    2 127.0.0.1:8000 - didReceiveAuthenticationChallenge - Simulating cancelled authentication sheet
     1127.0.0.1:8000 - didReceiveAuthenticationChallenge - ProtectionSpaceAuthenticationSchemeHTTPBasic - Simulating cancelled authentication sheet
     2127.0.0.1:8000 - didReceiveAuthenticationChallenge - ProtectionSpaceAuthenticationSchemeHTTPBasic - Simulating cancelled authentication sheet
    33Test for bug 13075: XMLHttpRequest with failed authentication should set status to 401.
    44
  • trunk/LayoutTests/platform/wk2/http/tests/xmlhttprequest/remember-bad-password-expected.txt

    r234897 r234912  
    1 127.0.0.1:8000 - didReceiveAuthenticationChallenge - Simulating cancelled authentication sheet
    2 127.0.0.1:8000 - didReceiveAuthenticationChallenge - Simulating cancelled authentication sheet
     1127.0.0.1:8000 - didReceiveAuthenticationChallenge - ProtectionSpaceAuthenticationSchemeHTTPBasic - Simulating cancelled authentication sheet
     2127.0.0.1:8000 - didReceiveAuthenticationChallenge - ProtectionSpaceAuthenticationSchemeHTTPBasic - Simulating cancelled authentication sheet
    33rdar://problem/7062824 A wrong password entered for site or proxy auth remains in WebCore credential storage, and is sent with subsequent requests.
    44
  • trunk/Source/WebCore/ChangeLog

    r234910 r234912  
     12018-08-15  Ansh Shukla  <ansh_shukla@apple.com>
     2
     3        NSURLAuthenticationMethodOAuth challenges are surfaced to clients in -didReceiveAuthenticationChallenge as NSURLAuthenticationMethodDefault
     4        https://bugs.webkit.org/show_bug.cgi?id=186870
     5        <rdar://problem/41314410>
     6
     7        Reviewed by Alex Christensen.
     8
     9        Add the ProtectionSpaceAuthenticationSchemeOAuth type.
     10
     11        * platform/network/ProtectionSpaceBase.cpp:
     12        (WebCore::ProtectionSpaceBase::isPasswordBased const): Return yes because the oauth challenge
     13        expects a token in return.
     14        * platform/network/ProtectionSpaceBase.h:
     15        * platform/network/cocoa/ProtectionSpaceCocoa.mm:
     16        (WebCore::scheme):
     17        (WebCore::ProtectionSpace::nsSpace const):
     18
    1192018-08-15  Ben Richards  <benton_richards@apple.com>
    220
  • trunk/Source/WebCore/PAL/ChangeLog

    r234898 r234912  
     12018-08-15  Ansh Shukla  <ansh_shukla@apple.com>
     2
     3        NSURLAuthenticationMethodOAuth challenges are surfaced to clients in -didReceiveAuthenticationChallenge as NSURLAuthenticationMethodDefault
     4        https://bugs.webkit.org/show_bug.cgi?id=186870
     5        <rdar://problem/41314410>
     6
     7        Reviewed by Alex Christensen.
     8
     9        * pal/spi/cf/CFNetworkSPI.h: Declare OAuth string when not building against the
     10        internal SDK.
     11
    1122018-08-15  Aditya Keerthi  <akeerthi@apple.com>
    213
  • trunk/Source/WebCore/PAL/pal/spi/cf/CFNetworkSPI.h

    r234897 r234912  
    178178#endif
    179179@end
     180
     181extern NSString * const NSURLAuthenticationMethodOAuth;
    180182
    181183#endif // defined(__OBJC__)
  • trunk/Source/WebCore/platform/network/ProtectionSpaceBase.cpp

    r234897 r234912  
    109109    case ProtectionSpaceAuthenticationSchemeNTLM:
    110110    case ProtectionSpaceAuthenticationSchemeNegotiate:
     111    case ProtectionSpaceAuthenticationSchemeOAuth:
    111112        return true;
    112113    case ProtectionSpaceAuthenticationSchemeClientCertificateRequested:
  • trunk/Source/WebCore/platform/network/ProtectionSpaceBase.h

    r234897 r234912  
    5353    ProtectionSpaceAuthenticationSchemeClientCertificateRequested = 7,
    5454    ProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested = 8,
     55    ProtectionSpaceAuthenticationSchemeOAuth = 9,
    5556    ProtectionSpaceAuthenticationSchemeUnknown = 100
    5657};
  • trunk/Source/WebCore/platform/network/cocoa/ProtectionSpaceCocoa.mm

    r234897 r234912  
    2626#import "config.h"
    2727#import "ProtectionSpaceCocoa.h"
     28
     29#import <pal/spi/cf/CFNetworkSPI.h>
    2830
    2931namespace WebCore {
     
    8183        return ProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested;
    8284#endif
     85    if ([method isEqualToString:NSURLAuthenticationMethodOAuth])
     86        return ProtectionSpaceAuthenticationSchemeOAuth;
    8387
    8488    ASSERT_NOT_REACHED();
     
    156160        break;
    157161#endif
     162    case ProtectionSpaceAuthenticationSchemeOAuth:
     163        method = NSURLAuthenticationMethodOAuth;
     164        break;
    158165    default:
    159166        ASSERT_NOT_REACHED();
  • trunk/Source/WebKit/ChangeLog

    r234910 r234912  
     12018-08-15  Ansh Shukla  <ansh_shukla@apple.com>
     2
     3        NSURLAuthenticationMethodOAuth challenges are surfaced to clients in -didReceiveAuthenticationChallenge as NSURLAuthenticationMethodDefault
     4        https://bugs.webkit.org/show_bug.cgi?id=186870
     5        <rdar://problem/41314410>
     6
     7        Reviewed by Alex Christensen.
     8
     9        Correctly expose the OAuth protection space type in API.
     10
     11        * UIProcess/API/C/WKAPICast.h:
     12        (WebKit::toAPI):
     13        * UIProcess/API/C/WKProtectionSpaceTypes.h:
     14
    1152018-08-15  Ben Richards  <benton_richards@apple.com>
    216
  • trunk/Source/WebKit/UIProcess/API/C/WKAPICast.h

    r234897 r234912  
    365365    case WebCore::ProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested:
    366366        return kWKProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested;
     367    case WebCore::ProtectionSpaceAuthenticationSchemeOAuth:
     368        return kWKProtectionSpaceAuthenticationSchemeOAuth;
    367369    default:
    368370        return kWKProtectionSpaceAuthenticationSchemeUnknown;
  • trunk/Source/WebKit/UIProcess/API/C/WKProtectionSpaceTypes.h

    r234897 r234912  
    5454    kWKProtectionSpaceAuthenticationSchemeClientCertificateRequested,
    5555    kWKProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested,
     56    kWKProtectionSpaceAuthenticationSchemeOAuth,
    5657    kWKProtectionSpaceAuthenticationSchemeUnknown = 100,
    5758};
  • trunk/Tools/ChangeLog

    r234910 r234912  
     12018-08-15  Ansh Shukla  <ansh_shukla@apple.com>
     2
     3        NSURLAuthenticationMethodOAuth challenges are surfaced to clients in -didReceiveAuthenticationChallenge as NSURLAuthenticationMethodDefault
     4        https://bugs.webkit.org/show_bug.cgi?id=186870
     5        <rdar://problem/41314410>
     6
     7        Reviewed by Alex Christensen.
     8
     9        * WebKitTestRunner/TestController.cpp:
     10        (WTR::toString):
     11        (WTR::TestController::canAuthenticateAgainstProtectionSpace): Expose type of authentication challenge so we can test OAuth.
     12        (WTR::TestController::didReceiveAuthenticationChallenge):
     13
    1142018-08-15  Ben Richards  <benton_richards@apple.com>
    215
  • trunk/Tools/WebKitTestRunner/TestController.cpp

    r234897 r234912  
    18101810}
    18111811
     1812static const char* toString(WKProtectionSpaceAuthenticationScheme scheme)
     1813{
     1814    switch (scheme) {
     1815    case kWKProtectionSpaceAuthenticationSchemeDefault:
     1816        return "ProtectionSpaceAuthenticationSchemeDefault";
     1817    case kWKProtectionSpaceAuthenticationSchemeHTTPBasic:
     1818        return "ProtectionSpaceAuthenticationSchemeHTTPBasic";
     1819    case kWKProtectionSpaceAuthenticationSchemeHTMLForm:
     1820        return "ProtectionSpaceAuthenticationSchemeHTMLForm";
     1821    case kWKProtectionSpaceAuthenticationSchemeNTLM:
     1822        return "ProtectionSpaceAuthenticationSchemeNTLM";
     1823    case kWKProtectionSpaceAuthenticationSchemeNegotiate:
     1824        return "ProtectionSpaceAuthenticationSchemeNegotiate";
     1825    case kWKProtectionSpaceAuthenticationSchemeClientCertificateRequested:
     1826        return "ProtectionSpaceAuthenticationSchemeClientCertificateRequested";
     1827    case kWKProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested:
     1828        return "ProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested";
     1829    case kWKProtectionSpaceAuthenticationSchemeOAuth:
     1830        return "ProtectionSpaceAuthenticationSchemeOAuth";
     1831    case kWKProtectionSpaceAuthenticationSchemeUnknown:
     1832        return "ProtectionSpaceAuthenticationSchemeUnknown";
     1833    }
     1834    ASSERT_NOT_REACHED();
     1835    return "ProtectionSpaceAuthenticationSchemeUnknown";
     1836}
     1837
    18121838bool TestController::canAuthenticateAgainstProtectionSpace(WKPageRef page, WKProtectionSpaceRef protectionSpace)
    18131839{
     
    18211847    }
    18221848   
    1823     return authenticationScheme <= kWKProtectionSpaceAuthenticationSchemeHTTPDigest;
     1849    return authenticationScheme <= kWKProtectionSpaceAuthenticationSchemeHTTPDigest || authenticationScheme == kWKProtectionSpaceAuthenticationSchemeOAuth;
    18241850}
    18251851
     
    18411867    WKProtectionSpaceRef protectionSpace = WKAuthenticationChallengeGetProtectionSpace(authenticationChallenge);
    18421868    WKAuthenticationDecisionListenerRef decisionListener = WKAuthenticationChallengeGetDecisionListener(authenticationChallenge);
    1843 
    1844     if (WKProtectionSpaceGetAuthenticationScheme(protectionSpace) == kWKProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested) {
     1869    WKProtectionSpaceAuthenticationScheme authenticationScheme = WKProtectionSpaceGetAuthenticationScheme(protectionSpace);
     1870
     1871    if (authenticationScheme == kWKProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested) {
    18451872        // Any non-empty credential signals to accept the server trust. Since the cross-platform API
    18461873        // doesn't expose a way to create a credential from server trust, we use a password credential.
     
    18591886    std::string host = toSTD(adoptWK(WKProtectionSpaceCopyHost(protectionSpace)).get());
    18601887    int port = WKProtectionSpaceGetPort(protectionSpace);
    1861     String message = String::format("%s:%d - didReceiveAuthenticationChallenge - ", host.c_str(), port);
     1888    String message = String::format("%s:%d - didReceiveAuthenticationChallenge - %s - ", host.c_str(), port, toString(authenticationScheme));
    18621889    if (!m_handlesAuthenticationChallenges)
    18631890        message.append("Simulating cancelled authentication sheet\n");
Note: See TracChangeset for help on using the changeset viewer.