尝试使用 REST 对 SharePoint 访问进行身份验证时无效的 STS 请求 API

Invalid STS Request when Trying to Authenticate for SharePoint Access with REST API

我正在尝试按照下面 link 中的说明进行操作,但它在第 1 步就失败了。https://login.microsoftonline.com/extSTS.srf 的响应是 "Invalid Request"。我正在将 XML 直接复制到 Postman 中,更新 username/password,然后发布到那个 url,但它不喜欢它。我还需要设置其他东西吗?并确认一下,如果我简单地搞砸 username/password 就不会出现这种错误,对吗?

https://allthatjs.com/2012/03/28/remote-authentication-in-sharepoint-online/

错误响应:

<?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>0x80045c01</psf:reqstatus>
            <psf:serverInfo ServerTime="2020-05-27T18:00:52.0727053Z">PROD-CHI-012.ProdSlices rid:83065b9d-8e7e-40a7-a3df-842141279c00</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:InvalidRequest</S:Value>
                </S:Subcode>
            </S:Code>
            <S:Reason>
                <S:Text xml:lang="en-US">Invalid Request</S:Text>
            </S:Reason>
            <S:Detail>
                <psf:error xmlns:psf="http://schemas.microsoft.com/Passport/SoapServices/SOAPFault">
                    <psf:value>0x80045C01</psf:value>
                    <psf:internalerror>
                        <psf:code>0x80045C01</psf:code>
                        <psf:text>AADSTS90023: Invalid STS request.</psf:text>
                    </psf:internalerror>
                </psf:error>
            </S:Detail>
        </S:Fault>
    </S:Body>
</S:Envelope>

你可以关注这个demo

我的测试demo供大家参考。