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

The remote server returned an error: (403) Forbidden #7

Open
nareshkun opened this issue Jul 7, 2020 · 3 comments
Open

The remote server returned an error: (403) Forbidden #7

nareshkun opened this issue Jul 7, 2020 · 3 comments
Assignees
Labels
bug Something isn't working needs investigation

Comments

@nareshkun
Copy link

Ran PowerShell script and getting the following error after authenticating using weblogin

Apply-PnPTenantTemplate : The remote server returned an error: (403) Forbidden.
At C:\Users{usrname}\OneDrive\SACHA\RnD\setupSitedesignStudio.ps1:25 char:1

  • Apply-PnPTenantTemplate -Path .\SiteDesignsStudio.pnp -Parameter @{Te ...
  •   + CategoryInfo          : NotSpecified: (:) [Apply-PnPTenantTemplate], WebException
      + FullyQualifiedErrorId : System.Net.WebException,SharePointPnP.PowerShell.Commands.Provisioning 
     .Tenant.ApplyTenantTemplate
    
@nareshkun
Copy link
Author

Successfully setup with out using weblogin.
image

@miguelisidoro
Copy link

Getting same error if not using -WebLogin in a tenant without MFA.
In a tenant with MFA, I am getting the same 403 Forbidden error.

What is the fix here?

At https://github.com/pnp/sp-site-designs-studio, you say.

"API Permissions
In order to allow the lookup of users and groups in the current tenant, The permission Directory.AccessAsUser.All to Microsoft Graph API is requested.

CAUTION: The solution is installed globally on the tenant, it means this permission, when granted, will be granted to the whole tenant. However, it will allow the application to only see the groups and users the current user is allowed to see. Thus, it should not cause any security breach. It will only be needed for the ability to grant Site Designs to specific principals. The other features will be working seamlessly without this granted permission."

But it seems a MFA issue to me.

Can you help?

@ypcode
Copy link
Collaborator

ypcode commented Jul 13, 2020

Hello,

Indeed, it seems to have several issues with MFA, I initially added the options for MFA, leveraging WebLogin option... but it turns out that this authentication method has several caveats in PnP PowerShell... :(

I will do my best to provide a workaround guide for MFA forced tenants using app principal authentication :)

Stay tuned!

Regards,
Yannick

@ypcode ypcode added the bug Something isn't working label Jul 21, 2020
@ypcode ypcode self-assigned this Jul 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs investigation
Projects
None yet
Development

No branches or pull requests

3 participants