How to hide login prompt for Sharepoint 2016 admin URL's (via internet) when anonymous user try to a

%3CLINGO-SUB%20id%3D%22lingo-sub-354539%22%20slang%3D%22en-US%22%3EHow%20to%20hide%20login%20prompt%20for%20Sharepoint%202016%20admin%20URL's%20(via%20internet)%20when%20anonymous%20user%20try%20to%20a%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-354539%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%3EI%20have%20built%20a%20public%20website%20via%20SharePoint%26nbsp%3B2016%20and%20have%20enabled%20anonymous%20user%20access%20to%20it.%20But%20the%20issue%20is%2C%20if%20an%20anonymous%20user%20tries%20to%20access%20an%20admin%20link%20a%20login%20prompt%20pops%20up.%20How%20could%20i%20only%20show%20the%20login%20prompt%20if%20the%20request%20comes%20only%20with%20in%20an%20intranet.%20I%20have%20tried%20many%20solutions%20from%20google%20results%20but%20with%20no%20success.%20Any%20help%20would%20be%20greatly%20appreciated.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-355960%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20hide%20login%20prompt%20for%20Sharepoint%202016%20admin%20URL's%20(via%20internet)%20when%20anonymous%20user%20try%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-355960%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F288461%22%20target%3D%22_blank%22%3E%40nawazpa_%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ewelcome%20%3A)%3C%2Fimg%3E%3C%2FP%3E%3CP%3EIn%20this%20case%2C%20it%20is%20a%20production%20environement%20with%20a%20publishing%20site%2C%20more%20likely%20a%20cross%20publishing%20sites%2C%20without%20needs%20of%20authentication%20for%20users%20(es%20document%20library%2C%20etc).%3C%2FP%3E%3CP%3EYou%20need%20to%20remove%20Windows%20Authentication%20from%20authentication%20providers%20of%20your%20Webapplication%2C%20but%20in%20this%20way%2C%20you%20can't%20access%20as%20authenticated%20user%20in%20no%20case.%3C%2FP%3E%3CP%3EEvery%20time%20you%20need%20to%20modify%20your%20site%2C%20you%20must%20change%20authentication%20providers.%3C%2FP%3E%3CP%3ELet%20me%20know.%3C%2FP%3E%3CP%3ECheers%2C%3C%2FP%3E%3CP%3EFederico%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-355949%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20hide%20login%20prompt%20for%20Sharepoint%202016%20admin%20URL's%20(via%20internet)%20when%20anonymous%20user%20try%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-355949%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F138334%22%20target%3D%22_blank%22%3E%40Federico%20Porceddu%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20a%20lot%20for%20your%20help.%20These%20guys%20(%3CA%20href%3D%22http%3A%2F%2Fdubai.ae%2F_layouts%2F15%2Fpeople.aspx%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttp%3A%2F%2Fdubai.ae%2F_layouts%2F15%2Fpeople.aspx%3C%2FA%3E)%20seem%20to%20have%20done%20it%20some%20how%20-%20showing%20'unauthorized'%20page%20directly%20without%20the%20login%20prompt.%20Any%20idea%20how%20they%20have%20done%20it.%20It%20would%20be%20a%20great%20help.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERegards%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EShanavas%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-355903%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20hide%20login%20prompt%20for%20Sharepoint%202016%20admin%20URL's%20(via%20internet)%20when%20anonymous%20user%20try%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-355903%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F288461%22%20target%3D%22_blank%22%3E%40nawazpa_%3C%2FA%3E%20perfect%20%3A)%3C%2Fimg%3E%3C%2FP%3E%3CP%3EYou%20can't%20prevent%20to%20show%20authentication%20popup%2C%20but%20you%20can%20hide%20links%20from%20masterpage%20(ie%20ribbon%2C%20settings)%20or%20from%20page%20layout.%3C%2FP%3E%3CP%3EYou%20need%20to%20use%26nbsp%3B%3CSTRONG%3ESPSecurityTrimmedControl%3C%2FSTRONG%3E%20%3CSTRONG%3Eclass%3C%2FSTRONG%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fprevious-versions%2Foffice%2Fsharepoint-server%2Fms476454(v%3Doffice.15)%26nbsp%3B%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fprevious-versions%2Foffice%2Fsharepoint-server%2Fms476454(v%3Doffice.15)%26nbsp%3B%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMake%20a%20copy%20of%20the%20MasterPage%2C%20or%20modify%20your%20current%20MasterPage%2C%20and%20wrap%20all%20parts%20you%20need%20to%20%22hide%22%20to%20Anonymous%20users%20with%20this%20snippet%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CSPSECURITYTRIMMEDCONTROL%20runat%3D%22%E2%80%9Dserver%E2%80%9D%22%20authenticationresctriction%3D%22%26quot%3B%26lt%3BSTRONG%22%3EAuthenticateUsersOnly%22%26gt%3B%3CBR%20%2F%3E%3CEM%3E%5Bhere%20there%20are%20features%20you%20need%20to%20show%20only%20for%20Authenticated%20people%5D%3C%2FEM%3E%3CBR%20%2F%3E%3C%2FSPSECURITYTRIMMEDCONTROL%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EYou%20can%20already%20put%20some%20feature%20you%20need%20only%20for%20Anonymous%20users%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CSPAN%3E%3CSPSECURITYTRIMMEDCONTROL%20runat%3D%22%E2%80%9Dserver%E2%80%9D%22%20authenticationresctriction%3D%22%26quot%3B%26lt%3BSTRONG%22%3EAnonymousUsersOnly%20%22%26gt%3B%3CBR%20%2F%3E%3CEM%3E%5Bhere%20there%20are%20features%20you%20need%20to%20show%20only%20for%20Authenticated%20people%5D%3C%2FEM%3E%3CBR%20%2F%3E%3C%2FSPSECURITYTRIMMEDCONTROL%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CSPAN%3ECheers%2C%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CSPAN%3EFederico%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-355881%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20hide%20login%20prompt%20for%20Sharepoint%202016%20admin%20URL's%20(via%20internet)%20when%20anonymous%20user%20try%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-355881%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%40Fed%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYes%20exactly%20%2C%20if%20an%20anonymous%20user%20tries%20a%20link%20like%20'%3CSPAN%3E_layouts%2F15%2Fsettings.aspx%3F%3C%2FSPAN%3E'%20an%20authentication%20popup%20shows.%20I%20need%20it%20to%20be%20hidden%20if%20tried%20from%20internet%20and%20only%20want%20windows%20authenticated%20users%20to%20access%20those%20links.%20I%20hope%20i%20am%20clear%20enough.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-355880%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20hide%20login%20prompt%20for%20Sharepoint%202016%20admin%20URL's%20(via%20internet)%20when%20anonymous%20user%20try%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-355880%22%20slang%3D%22en-US%22%3E%3CP%3EYes%2C%20you%20are%20right.%20If%20a%20user%20tries%26nbsp%3BSharepoint%20admin%20URL%20like%20_layouts%20and%20tries%20to%20access%20it%2C%20then%20the%20login%20prompt%20comes.%20But%20i%20don't%20want%20the%20popup%20to%20be%20displayed%20if%20a%20user%20tries%20to%20access%20the%20admin%20URL's%20from%20internet.%20I%20hope%20i%20am%20clear%20enough.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-355068%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20hide%20login%20prompt%20for%20Sharepoint%202016%20admin%20URL's%20(via%20internet)%20when%20anonymous%20user%20try%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-355068%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F288461%22%20target%3D%22_blank%22%3E%40nawazpa_%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhat%20would%20be%20the%20desired%20effect%3F%3C%2FP%3E%3CP%3EWhat%20would%20you%20like%20to%20happen%20at%20the%20click%20of%20one%20of%20these%20links%3F%3C%2FP%3E%3CP%3ECould%20you%20please%20give%20us%20an%20example%20of%20a%20link%20that%20generates%20the%20authentication%20popup%3F%3C%2FP%3E%3CP%3E_layouts%2F15%2Fsettings.aspx%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECheers%3C%2FP%3E%3CP%3EFederico%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-354618%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20hide%20login%20prompt%20for%20Sharepoint%202016%20admin%20URL's%20(via%20internet)%20when%20anonymous%20user%20try%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-354618%22%20slang%3D%22en-US%22%3ENot%20sure%20If%20I%20follow%20you%20here%3A%20if%20anonymous%20access%20has%20been%20enabled%20in%20the%20site%2C%20the%20credentials%20prompt%20should%20not%20show%20up%20to%20the%20user%20unless%20he%2Fshe%20is%20trying%20to%20access%20a%20resource%20that%20requires%20permissions%3C%2FLINGO-BODY%3E
Highlighted
New Contributor

I have built a public website via SharePoint 2016 and have enabled anonymous user access to it. But the issue is, if an anonymous user tries to access an admin link a login prompt pops up. How could i only show the login prompt if the request comes only with in an intranet. I have tried many solutions from google results but with no success. Any help would be greatly appreciated.

7 Replies
Highlighted
Not sure If I follow you here: if anonymous access has been enabled in the site, the credentials prompt should not show up to the user unless he/she is trying to access a resource that requires permissions
Highlighted

Hi @nawazpa_ 

What would be the desired effect?

What would you like to happen at the click of one of these links?

Could you please give us an example of a link that generates the authentication popup?

_layouts/15/settings.aspx?

 

Cheers

Federico

Highlighted

Yes, you are right. If a user tries Sharepoint admin URL like _layouts and tries to access it, then the login prompt comes. But i don't want the popup to be displayed if a user tries to access the admin URL's from internet. I hope i am clear enough.

Highlighted

Hi @Fed

 

Yes exactly , if an anonymous user tries a link like '_layouts/15/settings.aspx?' an authentication popup shows. I need it to be hidden if tried from internet and only want windows authenticated users to access those links. I hope i am clear enough. 

Highlighted

Hi @nawazpa_ perfect :)

You can't prevent to show authentication popup, but you can hide links from masterpage (ie ribbon, settings) or from page layout.

You need to use SPSecurityTrimmedControl class 

https://docs.microsoft.com/en-us/previous-versions/office/sharepoint-server/ms476454(v=office.15) 

 

Make a copy of the MasterPage, or modify your current MasterPage, and wrap all parts you need to "hide" to Anonymous users with this snippet

 

<SharePoint:SpSecurityTrimmedControl runat=”server” AuthenticationResctriction="AuthenticateUsersOnly">
[here there are features you need to show only for Authenticated people]
</SharePoint:SpSecurityTrimmedControl>

 

You can already put some feature you need only for Anonymous users

<SharePoint:SpSecurityTrimmedControl runat=”server” AuthenticationResctriction="AnonymousUsersOnly ">
[here there are features you need to show only for Authenticated people]
</SharePoint:SpSecurityTrimmedControl>

 

 

Cheers,

Federico

 

Highlighted

Hi @Federico Porceddu ,

 

Thanks a lot for your help. These guys (http://dubai.ae/_layouts/15/people.aspx) seem to have done it some how - showing 'unauthorized' page directly without the login prompt. Any idea how they have done it. It would be a great help.

 

Regards,

 

Shanavas

Highlighted

Hi @nawazpa_ 

welcome :)

In this case, it is a production environement with a publishing site, more likely a cross publishing sites, without needs of authentication for users (es document library, etc).

You need to remove Windows Authentication from authentication providers of your Webapplication, but in this way, you can't access as authenticated user in no case.

Every time you need to modify your site, you must change authentication providers.

Let me know.

Cheers,

Federico