Мой ответ будет таким же хорошим, как ваш вопрос, поскольку вы не предоставили много справочной информации, например. Версия Visual Studio, версия .NET framework, версия asp.net и т. Д.
Если вы используете VS 2010 и WIF, есть довольно удобный инструмент, называемый Magic Utility Wizard (FedUtil), который будет настраивать вас приложение «автоматически». Это article описывает именно то, что вам нужно.
В конце концов, модель личности вашего Web.config должен выглядеть следующим образом:
<microsoft.identityModel>
<service>
<audienceUris>
<add value="http://localhost:57349/ClaimsAwareWebSite2/" />
</audienceUris>
<federatedAuthentication>
<wsFederation passiveRedirectEnabled="true" issuer="https://<specified STS>/FederationPassive/" realm="http://localhost:57349/ClaimsAwareWebSite2/" requireHttps="false" />
<cookieHandler requireSsl="false" />
</federatedAuthentication>
<serviceCertificate>
<certificateReference x509FindType="FindByThumbprint" findValue="48BF03FCEDA703DE09E0F1F0CEFED60BB92B3DD8" storeLocation="LocalMachine" storeName="My" />
</serviceCertificate>
<applicationService>
<claimTypeRequired>
<!--Following are the claims offered by STS 'http://<specified STS>/Trust'. Add or uncomment claims that you require by your application and then update the federation metadata of this application.-->
<claimType type="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name" optional="true" />
<claimType type="http://schemas.microsoft.com/ws/2008/06/identity/claims/role" optional="true" />
<!--<claimType type="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress" optional="true" />-->
<!--<claimType type="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn" optional="true" />-->
<!--<claimType type="http://schemas.xmlsoap.org/claims/CommonName" optional="true" />-->
<!--<claimType type="http://schemas.xmlsoap.org/claims/EmailAddress" optional="true" />-->
<!--<claimType type="http://schemas.xmlsoap.org/claims/Group" optional="true" />-->
<!--<claimType type="http://schemas.xmlsoap.org/claims/UPN" optional="true" />-->
<!--<claimType type="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/privatepersonalidentifier" optional="true" />-->
<!--<claimType type="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/webpage" optional="true" />-->
<!--<claimType type="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/title" optional="true" />-->
<!--<claimType type="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/picture" optional="true" />-->
<!--<claimType type="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/manager" optional="true" />-->
<!--<claimType type="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/department" optional="true" />-->
</claimTypeRequired>
</applicationService>
<issuerNameRegistry type="Microsoft.IdentityModel.Tokens.ConfigurationBasedIssuerNameRegistry, Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<trustedIssuers>
<add thumbprint="5C8885A8E3D29D6BF6C9365E00B1BEA5EB284D1E" name="CN=<specified STS>, OU=US-Federated Identity, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" />
</trustedIssuers>
</issuerNameRegistry>
</service>
</microsoft.identityModel>
МНОГО должен быть изменен. Вы действительно должны прочитать об аутентификации федерации. – TheGeekYouNeed
Здравствуйте, Не могли бы вы предложить, что и как? Спасибо за ответ. Я использую VS 2010 и WIF 3.5.ADFS не имеет проверки подлинности формы. Теперь я хочу заменить существующий RP-код FormAuthentication, похожий на то, что будет FormsAuthenticationTicket, если у меня нет аутентификации формы сейчас? а также FormsAuthentication.FormsCookieName? В основном я не знаю, как использовать модуль WSFederationAuthentication и модуль Session в коде для доступа к файлам cookie и билетам и другой связанной информации. – user2250161