Owin.Security.CAS is an OWIN authentication provider for CAS
Too much on your plate to read through documentation? Need to get CAS authentication added to your MVC solution now? Here's what you need to do.
Install the NuGet package
PM> install-package Owin.Security.CAS
Open App_Start/Startup.Auth.cs
Add using Owin.Security.CAS;
to the end of the using
statements
Paste the following code below the // Uncomment the following lines to enable logging in with third party login providers
line
CasAuthenticationOptions casOptions = new CasAuthenticationOptions()
{
CasServerUrlBase = "https://your.cas.server.com/cas"
};
app.UseCasAuthentication(casOptions);
DONE!
PM> install-package Owin.Security.CAS
Using zip file
CAS authentication is enabled by calling app.UseCasAuthentication();
in the ConfigureAuth()
method in App_Start/Startup.Auth.cs. UseCasAuthentication()
takes a CasAuthenticationOptions
object that contains configuration options needed for connecting to your CAS server. At a minmum, the CasAuthenticationOptions
object needs to have the CasServerUrlBase
property set to the URL to your CAS server.
See the Examples section for some sample imlementations
AuthenticationMode
AuthenticationType
- String that appears in the button, and that is used for dbo.AspNetUserLogins.LoginProvider in the DB. Default: CAS
BackchannelHttpHandler
BackchannelTimeout
CallbackPath
Caption
- String that will replace "CAS" in the tool tip of the button. Default: CAS
CasServerUrlBase
- String containing the URL to your CAS serverDescription
NameClaimType
NameIdentifierAttribute
Provider
SignInAsAuthenticationType
StateDataFormat
TicketValidator
Equals()
GetHashCode()
GetType()
ToString()
This example is based on the default ASP.NET Web Application - MVC template, using Individual User Accounts Authentication.
Open App_Start/Startu.Auth.cs and make the following modifications
using Owin.Security.CAS;
// Uncomment the following lines to enable logging in with third party login providers
section
CasAuthenticationOptions casOptions = new CasAuthenticationOptions()
{
AuthenticationType = "Net ID", // change "CAS" to "Net ID" on the button and in DB
Caption = "Net ID", // change "CAS" to "Net ID" in tool tip
CasServerUrlBase = "https://cas-dev.tamu.edu/cas"
};
app.UseCasAuthentication(casOptions);