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

Unable to authenticate possibly due to Okta SSO / MFA #60

Open
sandemi1 opened this issue Feb 17, 2022 · 1 comment
Open

Unable to authenticate possibly due to Okta SSO / MFA #60

sandemi1 opened this issue Feb 17, 2022 · 1 comment

Comments

@sandemi1
Copy link

sandemi1 commented Feb 17, 2022

We suspect Okta's authentication service is preventing us from logging into Sharepoint O365. Looking for a solution that allows us to login to Sharepoint O365 through Okta's MFA service.

Python app response with correct/incorrect password and/or correct/incorrect user id:

Enter id: smithjo1
Enter password:
Connecting with id: smithjo1@company.net

*** Exception (ERPY-1.0.3) ***
*** Unable to upload file to SharePoint: MobaXterm Sessions7.mxtsessions
*** error: Token request failed. Invalid server response
*** exception: Token request failed. Invalid server response (<class 'sharepy.errors.AuthError'>)
*** function: uploadSharepoint() at line 62
*** source: sp = sharepy.SharePointSession("https://company.sharepoint.com", auth)
Token request failed. Invalid server response Unable to upload file to SharePoint: MobaXterm Sessions7.mxtsessions

XML from microsoft federation service:
https://login.microsoftonline.com/GetUserRealm.srf?login=smithjo1@company.net&xml=1

<RealmInfo Success="true">
<State>3</State>
<UserState>2</UserState>
<Login>smithjo1@company.net</Login>
<NameSpaceType>Federated</NameSpaceType>
<DomainName>company.net</DomainName>
<FederationGlobalVersion>-1</FederationGlobalVersion>
<AuthURL>https://company.okta.com/app/office365/<removed>/sso/wsfed/passive?username=smithjo1%40company.net&wa=wsignin1.0&wtrealm=urn%3afederation%3aMicrosoftOnline&wctx=</AuthURL>
<IsFederatedNS>true</IsFederatedNS>
<STSAuthURL>https://company.okta.com/app/office365/<removed>/sso/wsfed/active</STSAuthURL>
<FederationTier>0</FederationTier>
<FederationBrandName>company</FederationBrandName>
<AllowFedUsersWLIDSignIn>false</AllowFedUsersWLIDSignIn>
<Certificate>TUlJRG1qQ0NBb0tnQX...<removed>...</Certificate>
<MEXURL>https://company.okta.com/app/office365/<removed>/sso/wsfed/mex</MEXURL>
<PreferredProtocol>1</PreferredProtocol>
<EDUDomainFlags>0</EDUDomainFlags>
<CloudInstanceName>microsoftonline.com</CloudInstanceName>
<CloudInstanceIssuerUri>urn:federation:MicrosoftOnline</CloudInstanceIssuerUri>
</RealmInfo>

Python app source code snippet:

import requests
import sharepy

	auth = sharepy.auth.SharePointADFS(username=g.username, password=g.password)
	auth.login_url = "https://login.microsoftonline.com/extSES.srf"
	sp = sharepy.SharePointSession("https://company.sharepoint.com", auth)

Thank you.

@karimabuseer
Copy link

Probably want to authenticate using OAuth instead, which I don't think is currently supported

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