There is still plenty of trash being spewed out onto the internet, but it has moved on to other services. Thanks twitter.
Wednesday, May 13, 2009
Is blogging not cool anymore?
A few years ago, blogging became the latest rage. Everyone and their grandmother had a blog and was contributing dutifully to spewing random brain trash onto the internet. I recenlty noticed how many of these blogs have died out or whithered away. It would be interesting to see the number of unique blog posts worldwide per month, to see if my personal experience actually matches reality.
Friday, May 08, 2009
Does this link work for you?
Today I was trying to activate support incidents for a client's MSDN subscription. I called Microsoft as their web page on MSDN suggested, and they told me I need to fill out a form, and email it back to them. Ok, no problem. They then told me the url where I could get the form. I typed it in and got an error. Weird, perhaps I can't type. So after a few attmepts at spelling it out on the phone, the MS guy emailed me the link. Still no go. At this point I was transfered to another department who told me to go to the same link. They tried to tell me that I may be using the wrong version of IE (I have IE7) or that my proxy server may be messing things up (no proxy server). In any case, I must be the moron because I got the "It works over here" response from them.
At this point, I want to know if anyone can actually see this link.
[UPDATE: I just tried this from home, still no go.]
[UPDATE 2: It works now. The trick as pointed out by Syd was that I had my country settings set to US. I do this so that I don't have to read all the MS pages in Dutch. Well it turns out that once I changed my country settins to the Netherlands, the url works. Thanks Syd.]
As emailed from MS:
------------------------------------------
Dear Joe,
As promised I send you the URL to activate the support for your MSDN subscription:
http://support.microsoft.com/activatesupport
Kind regards,
Microsoft B.V.
Tuesday, April 14, 2009
A new experience
I had a new experience today, a not so pleasant one. I got rear-ended by a taxi while on my motorcycle. Legally it was all his fault, but I am still pissed at myself for not seeing it. I'll have to be more critical of myself in the future about road position, etc.
Luckily I was not hurt, and the bike only had some cosmetic damage. I was able to ride it to the dealer and it should be back on the road in a day or two. In the meantime I am on a Suzuki V-Storm, not a bad bike from my impression so far.
Wednesday, April 08, 2009
A great tool
A quick note about a great free tool that I used on my last project to figure out what was really going on with my http traffic. The tool can do a lot more than that too:
Multiple authentication providers and SSO into MOSS
Recently I faced a problem where I had to enable a MOSS site to be accessible using three different methods. One was the standard windows authentication, the second was Forms authentication and the third was a SSO method where a user identification token came in the querysting.
Getting the first two up and running is documented in many places so I will not repeat that here. See these links for instance:
http://blogs.msdn.com/sharepoint/archive/2006/08/16/configuring-multiple-authentication-providers-for-sharepoint-2007.aspx
http://www.andrewconnell.com/blog/articles/HowToConfigPublishingSiteWithDualAuthProvidersAndAnonAccess.aspx
What was new for me was the third requirement. The specifics were that the querystring would contain a user token which could then be used to call a web service to authenticate the user. The user would not notice any of this and be logged in automatically. This method was used so that users coming from another portal could enjoy a Single Sign On experience when going to the MOSS site.
I solved this as follows:
Getting the first two up and running is documented in many places so I will not repeat that here. See these links for instance:
http://blogs.msdn.com/sharepoint/archive/2006/08/16/configuring-multiple-authentication-providers-for-sharepoint-2007.aspx
http://www.andrewconnell.com/blog/articles/HowToConfigPublishingSiteWithDualAuthProvidersAndAnonAccess.aspx
What was new for me was the third requirement. The specifics were that the querystring would contain a user token which could then be used to call a web service to authenticate the user. The user would not notice any of this and be logged in automatically. This method was used so that users coming from another portal could enjoy a Single Sign On experience when going to the MOSS site.
I solved this as follows:
- I extended the web site to yet another URL.
- I changed the login page (in the web.config of the newly extended web app) to a custom login page. * More on this later
- I added another membership provider line in the web.config of all the web applications corresponding to this site (Windows Integrated, Forms, SSO) which was the same as my forms membership provider except for two things:
- The name of the provider has to be different
- The applicationName is different
- The name of the provider has to be different
- I added a new role provider that is again the same as the role provider for Forms, just with a different name. (This I did since MOSS does not allow you to use the same membership or role provider for different zones)
- I then went to central admin and changed the authentication type of the zone corresponding to the SSO web app to forms. I specified the new authentication and role providers. Even though the authentication type is forms, the user never gets a chance to enter a username or password due to the code in the login page.
* This login page has logic in it to call a web service which accepts the token and returns the user name (if token is valid). It then uses the standard memership methods to authenticate the user based on the returned username and a static password that is the same for each user. These users are stored in the same database as the Forms users but with a different application name so that they can only be used from the SSO site.
I had also created some tools for user management that I then updated to be aware of multiple membership providers. For example, my web part that created a new users has a radio button choice in it that forces the choice of a Forms user or an SSO user. This drives which provider is used to create the user. Similar logic is used in user editing, listing, etc.
There are a number of alternatives to this solution such as creating a new user database for the SSO membership provider or even creating a new membership provider, however I found this technique to be the least amount of work and quite effective.
Labels:
Authentication Provider,
MOSS,
SharePoint,
SSO
Monday, February 09, 2009
Handy Hiding Panel
Often in SharePoint (Although this could be used elsewhere) I have a need to hide something from some users or in case of some situation. For instance I may want to hide a set of controls if the MOSS site is accessed from a specific URL (like the internet facing site).
In these cases I use a control I call the hiding panel. It is quite simple but so handy that I find it useful to blog about. The code first:
I define an abstract class that is the generic hiding panel - it only renders when the condition is true. I then can have many classes that inherit from the Hiding panel, each implementing their own version of the GetCondition method.
The example here has the Public url panel which only displays if the host portion of the url is 'public'. Mind you this is not the best production code, the string shoudl not be baked in here but that's not the point here.
To use this, you simply add the panel to your page layout (or ASPX page if not in MOSS) and use the same way as a panel:
Note that in SharePoint designer you should just be able to drag and drop this panel from the Server Controls list in the toolbox. If you are adding the code manually, you also need to register your assembly somewhere on the page with a register directive like
UPDATE: Today I was working with this code and realized that when the Panel renders, it can throw off the look of your web page due to its rendering of a DIV tag. To get around this, I simply stopped using a Panel control and switched to a PlaceHolder control. Cleaner rendering and no loss in functionality.
In these cases I use a control I call the hiding panel. It is quite simple but so handy that I find it useful to blog about. The code first:
using System.Web.UI.WebControls;
using System.Web;
using System.Web.UI;
namespace JoeDemo
{
public abstract class HidingPanel : Panel
{
protected override void Render(System.Web.UI.HtmlTextWriter writer)
{
if (GetCondition())
{
base.Render(writer);
}
}
protected abstract bool GetCondition();
}
[ToolboxData("<{0}: PublicUrlPanel runat=\"server\"></{0}: PublicUrlPanel>")]
public class PublicUrlPanel: HidingPanel
{
protected override bool GetCondition()
{
return HttpContext.Current.Request.Url.Host.ToLower() == "public";
}
}
}
I define an abstract class that is the generic hiding panel - it only renders when the condition is true. I then can have many classes that inherit from the Hiding panel, each implementing their own version of the GetCondition method.
The example here has the Public url panel which only displays if the host portion of the url is 'public'. Mind you this is not the best production code, the string shoudl not be baked in here but that's not the point here.
To use this, you simply add the panel to your page layout (or ASPX page if not in MOSS) and use the same way as a panel:
<myControls:PublicUrlPanel id="myPanel" runat="server">
<asp:Literal id="testLit" runat="server" Text="Accessed from public url"/>
</myControls:PublicUrlPanel>
Note that in SharePoint designer you should just be able to drag and drop this panel from the Server Controls list in the toolbox. If you are adding the code manually, you also need to register your assembly somewhere on the page with a register directive like
<%@ Register TagPrefix="myControls" Namespace="JoeDemo" Assembly="JoeDemo, Version=1.0.0.0, Culture=neutral, PublicKeyToken=aaaaaaaaaa"%>
UPDATE: Today I was working with this code and realized that when the Panel renders, it can throw off the look of your web page due to its rendering of a DIV tag. To get around this, I simply stopped using a Panel control and switched to a PlaceHolder control. Cleaner rendering and no loss in functionality.
Labels:
Hiding Panel,
SharePoint,
UserControl
Thursday, January 29, 2009
Nice tool for blogging source code
I was struggling with formatting the source code for my blog today and found this handy tool FORMAT MY SOURCE CODE FOR BLOGGING
Thanks Greg!
Thanks Greg!
Subscribe to:
Posts (Atom)
