SharePoint Claims Based Authentication Architectures Explained Part 3 SharePoint As A Browser Based Application

WIF, short for Microsoft Windows Identity Foundation, is a set of .net frameworks that allow for the creation of claimed aware applications. It gives the user the logic that is needed in order to successfully complete any WS-Federation requests. This is the protocol that builds onto others to offer the trust and security. That is why you are allowed to request a security token when you are using an application that is browser based.

With such a scenario, it appears that the claims in WIF are similar to authentication. When a user is going to sign in, the WIF redirects them to the logon page. Once the user has been authenticated then they will be taken back to the application automatically. You may see a page called Login.aspx but that could be nothing more than an empty page. This is there for those users that need to use a smart card for authentication.

All issuers will be configured to use a method that is natural and that is secure for them to sign in. A simple username and password is usually good enough. However, there are ways for Windows to cover the needs of employers that want a more secure method to be in place. Here are some examples to make that process easily understood.

wa = wsingin 1.0 wa is for action and it will tell you if you are logging in with the wisignin1.0 or if you are logging off with wsingout1.0.

wtreatlm = http://sharepointsecurity.com/SecureCenter/ – wtreatlm is for target realm. There is a Uniform Resource Indicator that is able to identify this application. The URI is used to identify the application that the user has logged into. It also allows other tasks to be done that are associated with the claims for the application as well as replying to addresses.

Once the issuer has authenticated who the user is, it gathers those claims that are necessary for the application with the wtrealm identifying what the target application is. All of this is offered with the security token and there is a privacy key. The application can encrypt the tokens too and then the public key ahs to be used to authenticate them.

The issuer will be told which application they are using so that the claims issued will only be for that particular application to operate. The issuer will ask the browser to take them back to the application. This will send the token to that application for the claims to be processed. After this is done, the user will have access to that given application.

Some of this process may sound familiar to you. This is due to the fact that the forms authentication uses a very similar technique inside of the return URL parameter. This is done when the issuer returns to the HTML page of the browser. This creates the

with the encoded tokens inside of it.

The action of the form is going to submit the toke to the URL that is configured for that application. The user won’t see this form because the issuer has JavaScript in place to post it. Should those scripts be disabled though the user will have to click a button in order to be able to post the response to the server.

For the user there is a Windows authentication in place. The user will click on the link in the application and then the browser will be redirected in a matter of seconds right back to the application. The user will login at that point. Should the issuer require more information from the user such as a username and password or the use of a smartcard it will be done at that time. From the users point of view this type of logon process is always the same no matter what they are accessing and that is what they are after.

Share

Comparing SPPrincipal Objects To See If Same Member

More because I needed to recall this method that anything. Simple helper method consuming two SPPrincpal objects to compare the membership. Simple property and type testing, nothing very fancy.

[csharp]

public static bool SameMember(SPPrincipal x, SPPrincipal y)

{

if ((x is SPGroup) && (y is SPGroup))

{

var leftGroup = x as SPGroup;

var rightGroup = y as SPGroup;

return string.Equals(leftGroup.Name, rightGroup.Name, StringComparison.CurrentCultureIgnoreCase);

}

if (!(x is SPUser) || !(y is SPUser))

{

return false;

}

var leftUser = x as SPUser;

var rightUser = y as SPUser;

if ((!leftUser.IsDomainGroup || !rightUser.IsDomainGroup) && (leftUser.IsDomainGroup || rightUser.IsDomainGroup))

{

return false;

}

return string.Equals(leftUser.LoginName, rightUser.LoginName, StringComparison.CurrentCultureIgnoreCase);

}

[/csharp]

Share

Interpolating Data Points On A Two Dimensional Regular Grid

This was a pain in the ass to figure out. So this method is for basic Bicubic interpolation, a principal based on cubic interpolation, targeted to be called to work with values and derivatives on that plain at any given point. The title of the post kind of says it all.

[cpp]

public: virtual Double __gc* CalcBiCubicInterpolation(Double __gc* __gc [] coeff __gc [], Double __gc* dir1Down, Double __gc* dir1Up, Double __gc* dir2Down, Double __gc* dir2Up, Double __gc* dir1, Double __gc* dir2) __gc []
{
Double __gc* numArray __gc [] = __gc new Double __gc*[0];
try
{
Double __gc* HD1 = 0;
Double __gc* HD2 = 0;
Double __gc* HD3 = 0;
Double __gc* evalDir1 = (dir1Up – dir1Down);
Double __gc* evalDir2 = (dir2Up – dir2Down);
Double __gc* finDirCalc1 = ((dir2Up – dir1Down) / evalDir1);
Double __gc* finDirCalc2 = ((dir2 – dir2Down) / evalDir2);
HD1 = Process(finDirCalc1, HD1, coeff, finDirCalc2, ref HD3, ref HD2);
HD2 /= evalDir1;
HD3 /= evalDir2;
numArray = __gc new Double __gc*[3] {
HD1, HD2, HD3};
}
catch (ArithmeticException __gc* exception)
{
}
return numArray;
}

private: static Double __gc* Process(Double __gc* finDirCalc1, Double __gc* HD1, Double __gc* __gc [] coeff __gc [], Double __gc* finDirCalc2, Double __gc*& HD3, Double __gc*& HD2)
{
for (Int32 __gc* i = 3; (i >= 0); i–)
{
HD1 = (((finDirCalc1 * HD1) + (((((coeff[i][3] * finDirCalc2) + coeff[i][2]) * finDirCalc2) + coeff[i][1]) * finDirCalc2)) + coeff[i][0]);
HD3 = (((finDirCalc1 * HD3) + ((((3 * coeff[i][3]) * finDirCalc2) + (2 * coeff[i][2])) * finDirCalc2)) + coeff[i][1]);
HD2 = (((finDirCalc2 * HD2) + ((((3 * coeff[3][i]) * finDirCalc1) + (2 * coeff[2][i])) * finDirCalc1)) + coeff[1][i]);
}
return HD1;
}

[/cpp]

~~ These are the notes from my N.A. class @ UoM ~~

Share