1

I want to implement single sign on between an asp.net application and an existing SharePoint web application which is claims authentication enabled.

  1. asp.net application is farm authentication enabled and it authenticate users from sql server database.
  2. i created a custom STS service using asp.net security token service application using windows identity foundation in customsecuritytokenservicce class methods in GetOutputClaimsIdentity i added email outputIdentity.Claims.Add(new Claim(ClaimTypes.Email , "adil@test.com")); to issue email claim

3) i added sts reference to asp.net application

4) the same sts i registered using powershell to my sharepoint web application

$cert=New-object System.Security.Cryptography.X509Certificates.X509Certificate2("C:\SPPROJECTS\STS\stscert.cer")
$map1 = New-SPClaimTypeMapping -IncomingClaimType "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress" -IncomingClaimTypeDisplayName "EmailAddress" -SameAsIncoming
$map2 = New-SPClaimTypeMapping -IncomingClaimType "http://schemas.microsoft.com/ws/2008/06/identity/claims/role" -IncomingClaimTypeDisplayName "Role" -SameAsIncoming
$realm = "http://sp2010/_trust/default.aspx"
$ap=New-SPTrustedIdentityTokenIssuer -Name "STSPRO" -Description "Our Fancy CustomSTS" -Realm $realm -ClaimsMappings $map1,$map2 -ImportTrustCertificate $cert  -SignInUrl "https://localhost:96/login.aspx" -IdentifierClaim $map1.InputClaimType 
New-SPTrustedRootAuthority -Name "sp2010" -Certificate $cert

now when i open sharepoint site it shows two authenction opetions to login to sharepoint site, when i login using customsts i able to login to sharepoint site and it shows adil@test.com user , before that i added this user in sharepoint as administrator.

Now here

  1. How to wirte code the custom sts can validate user from sql server
  2. how i do or implement single sign on from asp.net to sharepoint site

when user authenticated to asp.net application and when user goes to sharepoint site from asp.net it would not ask authentication

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.