Skip to content

is_valid_auth_cookies() continually False, had to add values.get('SPOIDCRL') #306

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

Open
nefariousOne opened this issue Dec 14, 2020 · 1 comment
Labels

Comments

@nefariousOne
Copy link

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.

@vgrem vgrem added the bug label Dec 14, 2020
@joshyu
Copy link

joshyu commented Dec 16, 2020

Yes, I also met with this issue. always failed when checking the session cookie

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

No branches or pull requests

3 participants