Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting an undefined namespace error on this line. #115

Closed
mpastas opened this issue Jul 27, 2018 · 6 comments
Closed

Getting an undefined namespace error on this line. #115

mpastas opened this issue Jul 27, 2018 · 6 comments

Comments

@mpastas
Copy link
Contributor

mpastas commented Jul 27, 2018

Warning: DOMXPath::query(): Undefined namespace prefix in Office365\PHP\Client\Runtime\Auth\SamlTokenProvider->processSecurityTokenResponse()

$nodeErr = $xpath->query("//S:Fault/S:Detail/psf:error/psf:internalerror/psf:text")->item(0);

@mpastas
Copy link
Contributor Author

mpastas commented Jul 27, 2018

The response that this portion of code is analyzing:


<?xml version="1.0" encoding="utf-8"?><S:Envelope xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wst="http://schemas.xmlsoap.org/ws/2005/02/trust" xmlns:S="http://www.w3.org/2003/05/soap-envelope"><S:Header><psf:pp xmlns:psf="http://schemas.microsoft.com/Passport/SoapServices/SOAPFault"><psf:serverVersion>1</psf:serverVersion><psf:authstate>0x80048800</psf:authstate><psf:reqstatus>0x80048821</psf:reqstatus><psf:serverInfo ServerTime="2018-07-27T22:03:15.0167927Z">PROD-SAN-006.ProdSlices rid:855224d4-c224-4db6-a696-cdc4e71f1400</psf:serverInfo></psf:pp></S:Header>

<S:Body xmlns:S="http://www.w3.org/2003/05/soap-envelope">
<S:Fault><S:Code><S:Value>S:Sender</S:Value><S:Subcode><S:Value>wst:FailedAuthentication</S:Value></S:Subcode></S:Code><S:Reason><S:Text xml:lang="en-US">Authentication Failure</S:Text></S:Reason>
<S:Detail>
<psf:error xmlns:psf="http://schemas.microsoft.com/Passport/SoapServices/SOAPFault"><psf:value>0x80048821</psf:value><psf:internalerror><psf:code>0x80048821</psf:code>
<psf:text>

**AADSTS70002: Error validating credentials. AADSTS50126: Invalid username or password**

</psf:text>
</psf:internalerror>
</psf:error>
</S:Detail>
</S:Fault>
</S:Body>
</S:Envelope>

@mpastas
Copy link
Contributor Author

mpastas commented Jul 27, 2018

with:


if ($xpath->query("//S:Fault")->length > 0) {
            // Returning the full fault value in case any other response comes within the fault node.
            throw new \RuntimeException($xpath->query("//S:Fault")->item(0)->nodeValue);
        }

Exception will be read like this:

S:Senderwst:FailedAuthenticationAuthentication Failure0x800488210x80048821AADSTS70002: Error validating credentials. AADSTS50126: Invalid username or password

@mpastas
Copy link
Contributor Author

mpastas commented Jul 27, 2018

PR: #116

@mpastas
Copy link
Contributor Author

mpastas commented Aug 2, 2018

Resolved

@mpastas mpastas closed this as completed Aug 2, 2018
@mpastas
Copy link
Contributor Author

mpastas commented Aug 6, 2018

@vgrem would you mind to tag a version with this PR? Thanks a lot.
Mario.

@vgrem
Copy link
Owner

vgrem commented Aug 6, 2018

@mpastas , done! v2.2.1
Vadim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants