# Apereo .NET CAS Client #
[![Build status](https://ci.appveyor.com/api/projects/status/py9b6esq9smjr6u5/branch/master?svg=true)](https://ci.appveyor.com/project/mmoayyed/dotnet-cas-client/branch/master)
[![Stable nuget](https://img.shields.io/nuget/v/DotNetCasClient.svg?label=stable%20nuget)](https://www.nuget.org/packages/DotNetCasClient/)
[![Pre-release nuget](https://img.shields.io/myget/dotnetcasclient-prerelease/v/dotnetcasclient.svg?label=pre-release%20nuget)](https://www.myget.org/feed/dotnetcasclient-prerelease/package/nuget/DotNetCasClient)
[![Unstable nuget](https://img.shields.io/myget/dotnetcasclient-ci/v/dotnetcasclient.svg?label=unstable%20nuget)](https://www.myget.org/feed/dotnetcasclient-ci/package/nuget/DotNetCasClient)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![Gitter](https://img.shields.io/gitter/room/apereo/cas.svg)](https://gitter.im/apereo/dotnet-cas-client)
[![Stack Overflow](https://img.shields.io/badge/stackoverflow-cas%20%2B%20.net-orange.svg)](https://stackoverflow.com/questions/tagged/cas%2b.net)
## Introduction ##
The Apereo .NET CAS client provides CAS integration for the Microsoft Windows platform via the .NET framework.
## Features ##
- Supports CAS Protocol 1.0 and 2.0 and SAML 1.1
- Supports CAS single sign-out
- Rich support for Microsoft ASP.NET platform integration through Forms Authentication framework
## Table of Contents ##
* [Downloads](#downloads)
* [Release Notes](#release-notes)
* [License](#license)
* [Documentation](#documentation)
* [Building](#building)
* [Running](#running)
* [Integration Instructions](#integration-instructions)
## Downloads ##
* The latest (stable) release is [available on NuGet](https://www.nuget.org/packages/DotNetCasClient/) or can be [downloaded from GitHub](https://github.com/apereo/dotnet-cas-client/releases).
* Unstable pre-release versions are [available on MyGet](https://www.myget.org/feed/dotnetcasclient-prerelease/package/nuget/DotNetCasClient)
## Release Notes ##
See [ReleaseNotes.md](https://github.com/apereo/dotnet-cas-client/blob/master/ReleaseNotes.md) for details.
## License ##
The Apereo .NET CAS Client is open source software, licensed under the Apache License 2.0.
See [LICENSE.txt](https://github.com/apereo/dotnet-cas-client/blob/master/LICENSE.txt) for details.
## Documentation ##
- [Apereo .NET CAS Client](https://wiki.jasig.org/display/casc/.net+cas+client)
- [Apereo Central Authentication Service (CAS)](https://apereo.github.io/cas/)
### Building
The source is intended to be built with [Visual Studio 2017](https://www.visualstudio.com/downloads/) (any 2017 edition including the free Community edition will work.)
The project can also be built via the command line using a [Cake](https://www.cakebuild.net/) build script. If you are building from the command line, PowerShell or on a build server you must have the [Build Tools for Visual Studio 2017](https://www.visualstudio.com/downloads/) installed on the machine the build is occurring on.
To build the project from the command line, all you need to do is drop to PowerShell (or open a PowerShell window directly) and then run the **build.ps1** file to build the project and associated NuGet package. The NuGet package will be copied to the **artifacts** folder in the root of the repo when the build process has completed.
### Running
The build (via Visual Studio 2017) produces a single managed assembly, DotNetCasClient.dll, that may be included as a dependency of another project. However, it is recommended you install the NuGet package instead of referencing the DotNetCasClient.dll directly in a project because the NuGet package will handle adding/removing/updating other dependencies and references for you.
In addition to adding a dependency, the CAS integration must be configured via the web.config file. See the [Integration Instructions](#integration-instructions) below for details.
### Integration Instructions
The .NET CAS client integrates with ASP.NET applications by customizing the application web.config file. The client is implemented as an ASP.NET IHttpModule, CasAuthenticationModule, that provides hooks into the ASP.NET request/response pipeline through lifecycle events. This provides a familiar configuration path for client integration, including the following:
- Custom `casClientConfig` section containing CAS-specific configuration parameters that apply to `CasAuthenticationModule`
- ASP.NET forms authentication
- Registration of CasAuthenticationModule
- Authorization configuration
- Logging configuration (optional)
The `CasAuthenticationModule` must be made available to the application via the familiar process for .NET assemblies; either of the following is sufficient:
- Ensure it is deployed to the /Bin directory of the Web application
- Add it to the .NET Global Assembly Cache
- Configure `CasAuthenticationModule`
Define the casClientConfig configuration section:
- Register casClientConfig Section
```xml
<configSections>
<section name="casClientConfig"
type="DotNetCasClient.Configuration.CasClientConfiguration, DotNetCasClient"/>
<!-- Other custom sections here -->
</configSections>
```
Place a `<casClientConfig>` configuration element directly under the root `<configuration>` element. The position of the `<casClientConfig>` element in the web.config file is unimportant.
```xml
<casClientConfig
casServerLoginUrl="https://server.example.com/cas/login"
casServerUrlPrefix="https://server.example.com/cas/"
serverName="https://client.example.com:8443"
notAuthorizedUrl="~/NotAuthorized.aspx"
cookiesRequiredUrl="~/CookiesRequired.aspx"
redirectAfterValidation="true"
renew="false"
singleSignOut="true"
ticketValidatorName="Cas20"
serviceTicketManager="CacheServiceTicketManager" />
```
The following attributes are supported in the casClientConfig configuration section.
| Attribute | Description | Required |
| ----------| -----------| ----------|
| `casServerLoginUrl` | URL of CAS login form. | Yes
| `serverName ` | Host name of the server hosting this application. This is used to generate URLs that will be sent to the CAS server for redirection. The CAS server must be able to resolve this host name. If your web application is behind a load balancer, SSL offloader, or any other type of device that accepts incoming requests on behalf of the web application, you will generally need to supply the public facing host name unless your CAS server is in the same private network as the application server. The protocol prefix is optional (http:// or https://). If you are using a non-standard port number, be sure to include it (i.e., server.school.edu:8443 or https://server.school.edu:8443). Do not include the trailing backslash. | Yes
| `casServerUrlPrefix ` | URL to root of CAS server application. | Yes
| `ticketValidatorName ` | Name of ticket validator that validates CAS tickets using a particular protocol. Valid values are `Cas10, Cas20, and Saml11`. | Yes
| `gateway` | Enable CAS gateway feature, see http://www.jasig.org/cas/protocol section 2.1.1. Default is false. | No
| `renew` | Force user to reauthenticate to CAS before accessing this application. This provides additional security at the cost of usability since it effectively disables SSO for this application. Default is false. | No
| `singleSignOut ` | Enables this application to receive CAS single sign-out messages sent when the user's SSO session ends. This will cause the user's session in this application to be destroyed. Default is true. | No
| `ticketTimeTolerance` | Adds the given amount of tolerance in milliseconds to the client system time when evaluating the SAML assertion validity period. This effectively allows a given amount of system clock drift between the CAS client and server. Increasing this above the default value may have negative security consequences; we recommend fixing source
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
.net的casclient源码 (262个子文件)
CookieViewer.ascx 6KB
TicketManager.ascx 2KB
Default.aspx 2KB
Default.aspx 2KB
CookiesRequired.aspx 1KB
Default.aspx 1KB
Default.aspx 1KB
Default.aspx 1KB
NotAuthorized.aspx 1KB
Default.aspx 1KB
Default.aspx 1KB
build.cake 6KB
Web.config 1008B
Web.config 1002B
Web.config 993B
Web.config 957B
Web.config 957B
app.config 917B
packages.config 104B
CasAuthentication.cs 69KB
CasClientConfiguration.cs 18KB
UrlUtil.cs 18KB
CacheServiceTicketManager.cs 17KB
MemoryCacheServiceTicketManager.cs 16KB
DotNetCasProxyDemoForm.Designer.cs 15KB
RequestEvaluator.cs 14KB
EnhancedUriBuilder.cs 12KB
CasAuthenticationModule.cs 11KB
ReadOnlyXmlRoleProvider.cs 10KB
CasAuthenticationTicket.cs 9KB
SamlUtils.cs 9KB
CasPrincipal.cs 9KB
Saml11TicketValidator.cs 9KB
CasSaml11Response.cs 8KB
IServiceTicketManager.cs 7KB
DotNetCasProxyDemoForm.cs 7KB
Cas20ServiceTicketValidator.cs 6KB
AbstractUrlTicketValidator.cs 6KB
MemoryCacheManager.cs 6KB
Assertion.cs 6KB
CookieViewer.ascx.cs 6KB
TicketManager.ascx.cs 6KB
AssertionRoleProvider.cs 5KB
HttpUtil.cs 4KB
Default.aspx.cs 4KB
ITicketValidator.cs 4KB
CacheProxyTicketManager.cs 4KB
MemoryCacheProxyTicketManager.cs 4KB
Logger.cs 3KB
AuthnRequestType.cs 3KB
EntityDescriptorType.cs 3KB
Cas10TicketValidator.cs 3KB
RoleDescriptorType.cs 3KB
AssertionType.cs 3KB
Default.aspx.cs 3KB
TicketValidationException.cs 3KB
ICasPrincipal.cs 3KB
RequestAbstractType.cs 3KB
KeyInfoType.cs 3KB
StatusResponseType.cs 3KB
Resources.Designer.cs 3KB
IProxyTicketManager.cs 3KB
ServiceResponse.cs 3KB
ServiceResponse.cs 3KB
AssertionType.cs 3KB
RequestType.cs 3KB
AffiliationDescriptorType.cs 3KB
AssertionUtil.cs 3KB
CommonUtils.cs 3KB
Category.cs 3KB
RequestedAuthnContextType.cs 2KB
RequestType.cs 2KB
X509DataType.cs 2KB
EntitiesDescriptorType.cs 2KB
IdpSsoDescriptorType.cs 2KB
AdviceType.cs 2KB
AuthenticationFailure.cs 2KB
AuthenticationFailure.cs 2KB
ClearPassResponse.cs 2KB
EvidenceType.cs 2KB
EncryptedType.cs 2KB
LogoutRequestType.cs 2KB
AssemblyInfo.cs 2KB
AuthnContextType.cs 2KB
ResponseAbstractType.cs 2KB
AttributeAuthorityDescriptorType.cs 2KB
ContactType.cs 2KB
DsaKeyValueType.cs 2KB
SpSsoDescriptorType.cs 2KB
RequestAbstractType.cs 2KB
IAssertion.cs 2KB
AttributeConsumingServiceType.cs 2KB
ConditionsType.cs 2KB
PgpDataType.cs 2KB
ReferenceType.cs 2KB
ConditionsType.cs 2KB
AttributeType.cs 2KB
AuthorizationDecisionQueryType.cs 2KB
AuthnStatementType.cs 2KB
AuthorizationDecisionStatementType.cs 2KB
共 262 条
- 1
- 2
- 3
资源评论
qq_41782338
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功