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

Encountering a 403 Forbidden exception consistently #682

Open
lohith1024 opened this issue Sep 15, 2023 · 1 comment
Open

Encountering a 403 Forbidden exception consistently #682

lohith1024 opened this issue Sep 15, 2023 · 1 comment

Comments

@lohith1024
Copy link

lohith1024 commented Sep 15, 2023

Question

I'm using SharePoint 2016 on-premises, and I've been successfully connecting to the SharePoint server using the following code with my own credentials. This means that my Active Directory account is verified, allowing me to access SharePoint and perform various operations on the server.

Now, I need to use a service account to connect to SharePoint, which requires passing the service account's username and password. To test this configuration, I've disabled my default login account to ensure that I'm using the service account.

However, when attempting to connect to SharePoint with the service account, I'm encountering a 403 Forbidden exception consistently. It's important to note that the service account has been granted administrative privileges on this SharePoint instance.

Here's the code snippet I'm using for authentication:
OfficeDevPnP.Core.AuthenticationManager authenticationManager = new OfficeDevPnP.Core.AuthenticationManager();
var clientContext = authenticationManager.GetWebLoginClientContext(siteUrl);

Despite granting admin privileges to the service account, this code is resulting in a 403 Forbidden error.

i got my access removed and using service account, i get this error
AADSTS50105: Your administrator has configured the application SharePoint on-premises ddddd ('2342-234234-4d1b-899b-7ab3f6ee30e9') to block users unless they are specifically granted ('assigned') access to the application. The signed in user '[email protected]' is blocked because they are not a direct member of a group with access, nor had access directly assigned by an administrator. Please contact your administrator to assign access to this application.

@lohith1024 lohith1024 changed the title getting error Encountering a 403 Forbidden exception consistently Sep 15, 2023
@eoverfield
Copy link
Collaborator

This sounds like a PnP Core issue, I suggest you try the following issues list: https://github.com/pnp/pnpcore/issues

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

No branches or pull requests

2 participants