@@ -517,6 +517,36 @@ final public function testGetWebIdWithDpopWithoutSub(): void
517517 $ dpop ->getWebId ($ request );
518518 }
519519
520+ /**
521+ * @testdox Dpop SHOULD not complain WHEN asked to get WebId from Request with valid DPOP without "ath"
522+ *
523+ * @covers ::getWebId
524+ *
525+ * @uses \Pdsinterop\Solid\Auth\Utils\DPop::getDpopKey
526+ * @uses \Pdsinterop\Solid\Auth\Utils\DPop::validateDpop
527+ * @uses \Pdsinterop\Solid\Auth\Utils\DPop::validateJwtDpop
528+ */
529+ final public function testGetWebIdWithDpopWithoutOptionalAth (): void
530+ {
531+ unset($ this ->dpop ['payload ' ]['ath ' ]);
532+ $ token = $ this ->sign ($ this ->dpop );
533+
534+ $ mockJtiValidator = $ this ->createMockJtiValidator ();
535+ $ mockJtiValidator ->expects ($ this ->once ())
536+ ->method ('validate ' )
537+ ->willReturn (true )
538+ ;
539+ $ dpop = new DPop ($ mockJtiValidator );
540+
541+ $ request = new ServerRequest (array (
542+ 'HTTP_AUTHORIZATION ' => "dpop {$ this ->accessToken ['token ' ]}" ,
543+ 'HTTP_DPOP ' => $ token ['token ' ],
544+ ),array (), $ this ->url );
545+
546+ $ webId = $ dpop ->getWebId ($ request );
547+
548+ $ this ->assertEquals (self ::MOCK_SUBJECT , $ webId );
549+ }
520550 /**
521551 * @testdox Dpop SHOULD complain WHEN asked to get WebId from Request with valid DPOP without "ath"
522552 *
@@ -526,8 +556,11 @@ final public function testGetWebIdWithDpopWithoutSub(): void
526556 * @uses \Pdsinterop\Solid\Auth\Utils\DPop::validateDpop
527557 * @uses \Pdsinterop\Solid\Auth\Utils\DPop::validateJwtDpop
528558 */
529- final public function testGetWebIdWithDpopWithoutAth (): void
559+ final public function testGetWebIdWithDpopWithoutRequiredAth (): void
530560 {
561+ /*/ @see https://github.com/pdsinterop/php-solid-auth/issues/34 /*/
562+ $ this ->markTestSkipped ('ATH claim is not yet supported/required by the Solid OIDC specification. ' );
563+
531564 unset($ this ->dpop ['payload ' ]['ath ' ]);
532565 $ token = $ this ->sign ($ this ->dpop );
533566
0 commit comments