<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Adding users to SharePoint dynamically at first request after authentication</title><link>http://blogs.msdn.com/jannemattila/archive/2007/06/25/adding-users-to-sharepoint-dynamically-at-first-request-after-authentication.aspx</link><description>That title says it all! Well I was working on case where SharePoint was configured to use external authentication. This external authentication was hosted outside SharePoint and it could be used by many other services too. End users of SharePoint would</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>  Sharepoint link love 6-25-2007 at  Virtual Generations</title><link>http://blogs.msdn.com/jannemattila/archive/2007/06/25/adding-users-to-sharepoint-dynamically-at-first-request-after-authentication.aspx#3514502</link><pubDate>Mon, 25 Jun 2007 10:04:41 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3514502</guid><dc:creator>  Sharepoint link love 6-25-2007 at  Virtual Generations</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://www.virtual-generations.com/2007/06/25/sharepoint-link-love-6-25-2007/"&gt;http://www.virtual-generations.com/2007/06/25/sharepoint-link-love-6-25-2007/&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>re: Adding users to SharePoint dynamically at first request after authentication</title><link>http://blogs.msdn.com/jannemattila/archive/2007/06/25/adding-users-to-sharepoint-dynamically-at-first-request-after-authentication.aspx#4134090</link><pubDate>Mon, 30 Jul 2007 19:51:32 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4134090</guid><dc:creator>Amin Pirzadeh</dc:creator><description>&lt;p&gt;If you put your httpmodule under stress you will find that a lot of your requests will fail as setting the allowunsafeupdate flag can cause race condition.&lt;/p&gt;
&lt;p&gt;In other words, you have requests or threads that set the allowunsafeupdate to true and requests that are setting the flag to false running on some other threads&lt;/p&gt;
&lt;p&gt;:-(&lt;/p&gt;
</description></item><item><title>re: Adding users to SharePoint dynamically at first request after authentication</title><link>http://blogs.msdn.com/jannemattila/archive/2007/06/25/adding-users-to-sharepoint-dynamically-at-first-request-after-authentication.aspx#4142638</link><pubDate>Tue, 31 Jul 2007 08:25:04 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4142638</guid><dc:creator>jannemattila</dc:creator><description>&lt;p&gt;Hi Amin!&lt;/p&gt;
&lt;p&gt;That's interesting and good point... I haven't tested that scenario because it's not easy to setup. You would need to create script that would create http request for 10000 different users at the same time. And all of those users would need to be first timers, since that code is run only when user isn't already at the SharePoint. And it would be really easy to add locking to avoid that scenario you're referring in single box scenario (performance hit for locking wouldn't be that bad). It would be a bit harder to do it in medium-farm (or larger farms) but I think it would still achieaveable. &lt;/p&gt;
&lt;p&gt;But still you have made valid point and that's why I always try to mention that my code samples are only meant for examples and you need to make real test scripts and add more logic to make it usable in real life :-)&lt;/p&gt;
&lt;p&gt;Have you tested that kind of situation? And how did you solve the problem?&lt;/p&gt;
&lt;p&gt;Anyways... Happy hacking!&lt;/p&gt;
&lt;p&gt;J&lt;/p&gt;
</description></item><item><title>re: Adding users to SharePoint dynamically at first request after authentication</title><link>http://blogs.msdn.com/jannemattila/archive/2007/06/25/adding-users-to-sharepoint-dynamically-at-first-request-after-authentication.aspx#4212342</link><pubDate>Sat, 04 Aug 2007 00:18:57 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4212342</guid><dc:creator>Becky Isserman</dc:creator><description>&lt;p&gt;I am curious where you embedded the final code and how you embedded it. &amp;nbsp;Did you need visual studio on the actual environment to do it? &amp;nbsp;I have never attempted to embed code in Sharepoint, so I am sorry if this is a really simple question.&lt;/p&gt;
</description></item><item><title>re: Adding users to SharePoint dynamically at first request after authentication</title><link>http://blogs.msdn.com/jannemattila/archive/2007/06/25/adding-users-to-sharepoint-dynamically-at-first-request-after-authentication.aspx#4251381</link><pubDate>Mon, 06 Aug 2007 07:51:06 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4251381</guid><dc:creator>jannemattila</dc:creator><description>&lt;p&gt;Hi Becky!&lt;/p&gt;
&lt;p&gt;That code was compiled to DLL that was then deployed to the target SharePoint installation. Only &amp;quot;special&amp;quot; thing that was needed to do was to add new module under &amp;lt;httpModules&amp;gt; at the web.config. But of course this doesn't mean that you need to have Visual Studio at the server, just at your development machine. &lt;/p&gt;
&lt;p&gt;I hope I answered your question.&lt;/p&gt;
&lt;p&gt;Anyways.... Happy hacking!&lt;/p&gt;
&lt;p&gt;J&lt;/p&gt;
</description></item><item><title>re: Adding users to SharePoint dynamically at first request after authentication</title><link>http://blogs.msdn.com/jannemattila/archive/2007/06/25/adding-users-to-sharepoint-dynamically-at-first-request-after-authentication.aspx#4265932</link><pubDate>Mon, 06 Aug 2007 23:54:26 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4265932</guid><dc:creator>Becky Isserman</dc:creator><description>&lt;p&gt;I added the code above in a module, but when Access is requested it does not grant access automatically. &amp;nbsp;Also, &amp;quot;Microsoft.MCS.Authorization&amp;quot; would not work when I tried adding a line of code for the module. &amp;nbsp;What does your web.config entry look like? &amp;nbsp;&lt;/p&gt;
&lt;p&gt;Also, how did you get it to work on the Access Denied Page?&lt;/p&gt;
</description></item><item><title>re: Adding users to SharePoint dynamically at first request after authentication</title><link>http://blogs.msdn.com/jannemattila/archive/2007/06/25/adding-users-to-sharepoint-dynamically-at-first-request-after-authentication.aspx#4287275</link><pubDate>Wed, 08 Aug 2007 07:34:31 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4287275</guid><dc:creator>jannemattila</dc:creator><description>&lt;p&gt;Hi Becky!&lt;/p&gt;
&lt;p&gt;Have you debugged you code? I mean willl that code ever get executed? If not then you know why it won't give access rights automatically.&lt;/p&gt;
&lt;p&gt;My web.config entry looks like this:&lt;/p&gt;
&lt;p&gt;&amp;lt;add name=&amp;quot;MCSAuthorization&amp;quot; type=&amp;quot;Microsoft.MCS.Authorization.AddUserToSystem,Microsoft.MCS.Authorization, Version=1.0.0.0, Culture=neutral,PublicKeyToken=2d99e7422c714ab7&amp;quot; /&amp;gt;&lt;/p&gt;
&lt;p&gt;And let's forget about the hack with Access Denied Page since it not something you want to do.&lt;/p&gt;
&lt;p&gt;Anyways... Happy hacking!&lt;/p&gt;
&lt;p&gt;J&lt;/p&gt;
</description></item><item><title>re: Adding users to SharePoint dynamically at first request after authentication</title><link>http://blogs.msdn.com/jannemattila/archive/2007/06/25/adding-users-to-sharepoint-dynamically-at-first-request-after-authentication.aspx#7719852</link><pubDate>Fri, 15 Feb 2008 21:41:11 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7719852</guid><dc:creator>jupiterdaisy</dc:creator><description>&lt;p&gt;Is there any way I can get a copy of the original AccessDenied.aspx page? &amp;nbsp;My edits to that page completely messed it up. (I did backup the apge before I edited, but for some reason it is still messed up).&lt;/p&gt;
</description></item><item><title>re: Adding users to SharePoint dynamically at first request after authentication</title><link>http://blogs.msdn.com/jannemattila/archive/2007/06/25/adding-users-to-sharepoint-dynamically-at-first-request-after-authentication.aspx#8114062</link><pubDate>Sat, 08 Mar 2008 20:41:28 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8114062</guid><dc:creator>Emiliano</dc:creator><description>&lt;p&gt;Hi!&lt;/p&gt;
&lt;p&gt;how i can run the solution? what's the procedure to &amp;nbsp;test the code.&lt;/p&gt;
&lt;p&gt;thanks :)&lt;/p&gt;
</description></item><item><title>re: Adding users to SharePoint dynamically at first request after authentication</title><link>http://blogs.msdn.com/jannemattila/archive/2007/06/25/adding-users-to-sharepoint-dynamically-at-first-request-after-authentication.aspx#9029693</link><pubDate>Mon, 03 Nov 2008 00:30:43 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9029693</guid><dc:creator>Burt</dc:creator><description>&lt;p&gt;I developed something similar that includes information to help you to setup the sites.&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://icodehead.blogspot.com/"&gt;http://icodehead.blogspot.com/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Burt&lt;/p&gt;
</description></item></channel></rss>