koltyakov / gosip

⚡️ SharePoint SDK for Go
https://go.spflow.com
MIT License
140 stars 32 forks source link

SAML Auth: unable to get local issuer certificate #49

Closed rickdana closed 2 years ago

rickdana commented 2 years ago

I'm trying to connect to my company SharePoint site using SAML Auth.

During the Authentification step, the client calls this endpoints login.microsoftonline.com with the output bellow:

Error: unable to get local issuer certificate.

I'm having difficulties to troubleshoot this error so I though of setting InsecureSkipVerify: true for the HttpClient. I realised that the client used in the AuthCnfg is not exposed.

Is there any method to have InsecureSkipVerify set to true during the SAML authentication ?

rickdana commented 2 years ago

The pull request #47 (Bypass client to auth requests gives the ability to bypass the AuthConfig client. With that I'm able to set InsecureSkipVerify to true.

A go get -u solve the issue.

koltyakov commented 2 years ago

@rickdana you're fast!

Was going to suggest:

client := &gosip.SPClient{
    Client: http.Client{
        Transport: &http.Transport{
                        TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
                },
    }, 
    AuthCnfg: authCnfg,
}