I want to implement single sign on between an asp.net application and an existing SharePoint web application which is claims authentication enabled.
- asp.net application is farm authentication enabled and it authenticate users from sql server database.
- i created a custom STS service using asp.net security token service
application using windows identity foundation in
customsecuritytokenservicceclass methods in
GetOutputClaimsIdentityi added email
outputIdentity.Claims.Add(new Claim(ClaimTypes.Email , "firstname.lastname@example.org"));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 email@example.com user , before that i added this user in sharepoint as administrator.
- How to wirte code the custom sts can validate user from sql server
- 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