Forum Discussion
How to hide login prompt for Sharepoint 2016 admin URL's (via internet) when anonymous user try to a
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
- nawazpa_Feb 24, 2019Copper Contributor
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.
- Feb 24, 2019
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
- nawazpa_Feb 24, 2019Copper Contributor
Hi FedericoPorceddu82 ,
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