C# Client
Paul Hunnisett
Paul.Hunnisett at uwe.ac.uk
Tue Sep 4 04:03:41 EDT 2007
The library just performs authentication based on the service and the
ticket - the service URL (with or without parameters) simply needs to
match the one that CAS granted the ticket against. The client doesn't
redirect you anywhere - it just returns a username or XML, depending on
which method you call.
Incidentally, if you're using SOAP based web services, you shouldn't be
making GET requests anyway...
Cheers
Paul
-----Original Message-----
From: cas-bounces at tp.its.yale.edu [mailto:cas-bounces at tp.its.yale.edu]
On Behalf Of Juan Huerta
Sent: 03 September 2007 15:53
To: Yale CAS mailing list
Subject: Re: C# Client
cool, thank you very much. i'll take a look at it.
I'd like to use it to authenticate and secure the use of Web Services.
One question ... have you tried passing parameters?:
http://mycasifiedservice.com?myParameter=thisIsTheValue ?
would your library return to:
1. http://mycasifiedservice.com?myParameter=thisIsTheValue
or instead to
2. http://mycasifiedservice.com ?
In the first case, after authenticate, i still can make use of the
parameter ... in the second case, the parameter is lost ...
thanks,
Juan
2007/9/3, Paul Hunnisett <Paul.Hunnisett at uwe.ac.uk>:
> I haven't uploaded it as yet - but I've attached both the .dll and the
> source code to this email. It's called CasWebServiceClient - but it's
> suitable for any .Net context - perhaps I'll change the name...
>
> In terms of how to use it - The constructor takes the name of the
> service you are trying to authenticate against and the proxyValidate
> URL for your CAS server e.g.
>
> String service = "http://mycasifiedservice.com"; String validateURL =
> "https://mycasserver/cas/proxyValidate";
> CasWebServiceClient.CasWebServiceClient client = new
> CasWebServiceClient.CasWebServiceClient(service, validateURL);
>
> You can then either call the Authenticate method or call the GetCasXML
> method - both taking a ticket as a String. The Autheticate method
> will either return you a username, as provided by CAS, of 'failed'.
> The GetCasXML will simply return you the XML response from CAS or
null.
> This will be useful if you want to use SAML etc.
>
> If you just need a username then the Authenticate method will work for
> you:
>
> String userName = client.Authenticate(ticket);
>
> To use it in a web service - I've simply created a service with one
> method that takes a ticket as a parameter - this is in place of
> previous services which took a username and password. That method
> instantiates the CAS C# Client and then uses the returned username to
> return relevant data about the user.
>
> I hope all that makes sense - if not, just yell and I'll help as much
> as I can...
>
> Cheers
>
> Paul Hunnisett
> UWE
>
> -----Original Message-----
> From: cas-bounces at tp.its.yale.edu [mailto:cas-bounces at tp.its.yale.edu]
> On Behalf Of Juan Huerta
> Sent: 03 September 2007 12:02
> To: Yale CAS mailing list
> Subject: Re: C# Client
>
> Hi,
> Im using C# and Web Services. Im using already the implemention of ASP
> in the CAS documentation, but I'd like to take a look to that other
> implementation. Im using C# and Web Services, so, it may be quite
> handy for us ...
> Im having a lot of problems passing parameters to a web that have to
> be authenticated ... I notice that after calling CAS I loose the
paramters.
> Im doing something wrong that maybe you library can help me solve it.
>
> Please, let me know where I can take a look to the library and some
> sample on how to use it. Thanks!
>
> Juan
>
> 2007/9/3, Paul Hunnisett <Paul.Hunnisett at uwe.ac.uk>:
> >
> >
> > The difference between this client and the existing ASP .Net client
> > is
>
> > that this is a stand alone library which can be called by any .Net
> > application web - or non web alike. It's the difference between a
> > jar
>
> > file based client and a JSP based client. The advantage of the ASP
> > .Net client over mine is that you can take advantage of cookies; the
> > advantage of my client is that it can be used in contexts like SOAP
> > web services or desktop applications where cookies and page
> > redirects haev less or no meaning... The main motivation for
> > writing my client is that it's only useful for ASP .Net - whereas
> > mine can be used by any .Net application. Initially we want to use
> > it here to log into SOAP web services which don't maintain any
> > session data and don't use
> cookies.
> >
> > There may be some mileage in combining the two projects - although
> > in doing so you may lose the cookie advantage of the ASP .Net client
> > (perhaps not necessarily though...). to be honest, I'm not sure
> > whether it would be beneficial to combine them or provide a choice
> > given distinct advantages and disadvantages depending on your
context.
> >
> > If I upload to the Issue tracker should I start it as a new project
> > or
>
> > add it as a component to your CAS Clients project? I'm more than
> > happy to continue to manage and maintain it - and also take a lead
> > in merging it with the ASP .Net client - if we decide that's the way
> > to
> go...
> > Cheers
> >
> > Paul
> >
> > ________________________________
> > From: cas-bounces at tp.its.yale.edu
> > [mailto:cas-bounces at tp.its.yale.edu] On Behalf Of Scott Battaglia
> > Sent: 31 August 2007 16:42
> > To: Yale CAS mailing list
> > Subject: Re: C# Client
> >
> >
> > Paul,
> >
> > You can initially place it in our wiki or as a JIRA issue in the our
> > Issue Tracker (http://www.ja-sig.org/issues/). I don't know how
> > many developers here are familiar with C# to comment on the code.
> >
> > Maybe you can provide us with some details. How is this different
> > then the ASP .Net client written in C#. Is there a way to rewrite
> > the
>
> > existing one to utilize your underlying "core" libraries? Would
> > there
>
> > be interest in combining the two projects together if it makes
sense?
>
> > We're looking for people to volunteer to manage specific libraries
> under the JA-SIG banner.
> >
> > Thanks!
> > -Scott
> >
> >
> > On 8/31/07, Paul Hunnisett <Paul.Hunnisett at uwe.ac.uk> wrote:
> > >
> > >
> > > No-one able to tell me where to commit this or willing to review
> > > the
> code?
> > >
> > > ________________________________
> > From: cas-bounces at tp.its.yale.edu
> > [mailto:cas-bounces at tp.its.yale.edu] On Behalf Of Paul Hunnisett
> > > Sent: 30 August 2007 12:30
> > > To: Yale CAS mailing list
> > > Subject: C# Client
> > >
> > >
> > >
> > >
> > > I've built a C# client for CAS for use by .Net applications. I
> > > realise
> > that there's already an ASP .Net client written in C#, but that
> > assumes browser based apps. The motivation for writing mine was
> > that we needed SOAP web services to be able to authenticate via CAS
> > so that, where we used to pass a username and password, we now pass
> > a ticket and they use the CAS client to authenticate.
> > >
> > > I was going to ask one of the guys round here to read through my
> > > code and
> > review it to see if it's production quality or not but they're
> > either on annual leave or paternity leave... So, I figured that the
> > best thing to do was to release the client to the community,
> > including the source code, and ask for feedback on the quality of
> > the code. So - what's the best way of committing this? I've got
> > both a .dll and the
> source code...
> > >
> > > Cheers
> > >
> > > Paul Hunnisett
> > > UWE
> > >
> > >
> > > ________________________________
> > This email was independently scanned for viruses by McAfee
> > anti-virus
>
> > software and none were found
> > >
> > >
> > >
> > >
> > >
> > >
> > > ________________________________
> > This incoming email to UWE has been independently scanned for
> > viruses
>
> > by McAfee anti-virus software and none were detected
> > >
> > >
> > >
> > >
> > >
> > >
> > > ________________________________
> > This email was independently scanned for viruses by McAfee
> > anti-virus
>
> > software and none were found
> > >
> > >
> > > _______________________________________________
> > > Yale CAS mailing list
> > > cas at tp.its.yale.edu
> > > http://tp.its.yale.edu/mailman/listinfo/cas
> > >
> > >
> >
> >
> >
> > --
> > -Scott Battaglia
> >
> > LinkedIn: http://www.linkedin.com/in/scottbattaglia
> >
> >
> > ________________________________
> > This incoming email to UWE has been independently scanned for
> > viruses
>
> > by McAfee anti-virus software and none were detected
> >
> >
> >
> >
> >
> >
> > ________________________________
> > This email was independently scanned for viruses by McAfee
> > anti-virus
>
> > software and none were found
> >
> >
> > _______________________________________________
> > Yale CAS mailing list
> > cas at tp.its.yale.edu
> > http://tp.its.yale.edu/mailman/listinfo/cas
> >
> >
> _______________________________________________
> Yale CAS mailing list
> cas at tp.its.yale.edu
> http://tp.its.yale.edu/mailman/listinfo/cas
>
>
> This incoming email to UWE has been independently scanned for viruses
> by McAfee anti-virus software and none were detected
>
>
> This email was independently scanned for viruses by McAfee anti-virus
> software and none were found
>
> _______________________________________________
> Yale CAS mailing list
> cas at tp.its.yale.edu
> http://tp.its.yale.edu/mailman/listinfo/cas
>
>
>
_______________________________________________
Yale CAS mailing list
cas at tp.its.yale.edu
http://tp.its.yale.edu/mailman/listinfo/cas
This incoming email to UWE has been independently scanned for viruses by
McAfee anti-virus software and none were detected
This email was independently scanned for viruses by McAfee anti-virus software and none were found
More information about the cas
mailing list