You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying to use this module to authenticate against our SPO tenant but would keep getting "An error occurred while retrieving auth cookies from ...". I tried with ClientContext vs UserContext which worked fine but anytime I tried to pass user credentials with UserContext it failed.
By replacing def is_valid_auth_cookies(values): return any(values) and values.get('FedAuth', None) is not None
with def is_valid_auth_cookies(values): return any(values) and (values.get('FedAuth', None) is not None or (values.get('SPOIDCRL') is not None))
I hope this helps someone else out or, if I missed something, any guidance is always welcomed but at this point I can successfully connect to SPO using this module and pass the cookie along with subsequent requests.
The text was updated successfully, but these errors were encountered:
I was trying to use this module to authenticate against our SPO tenant but would keep getting "An error occurred while retrieving auth cookies from ...". I tried with ClientContext vs UserContext which worked fine but anytime I tried to pass user credentials with UserContext it failed.
After some investigation it was due to is_valid_auth_cookies() looking explicitly for "FedAuth" which our SSO provider does not pass, instead I had to add a match for "SPOIDCRL" as mentioned in this article https://techcommunity.microsoft.com/t5/microsoft-sharepoint-blog/sharepoint-online-active-authentication/ba-p/510052.
By replacing
def is_valid_auth_cookies(values): return any(values) and values.get('FedAuth', None) is not None
with
def is_valid_auth_cookies(values): return any(values) and (values.get('FedAuth', None) is not None or (values.get('SPOIDCRL') is not None))
I hope this helps someone else out or, if I missed something, any guidance is always welcomed but at this point I can successfully connect to SPO using this module and pass the cookie along with subsequent requests.
The text was updated successfully, but these errors were encountered: