Hi Juan I am not sure that I can help, but I wrote an http module that acts as an authentication provider. I the .NET world, all http request flows through that module. The module does the authentication job and create a user principal in the request context. So you can simply have the user name with User.name and you can also have something User.IsInRole with some additional code (5 lines).
The dll, explanation and source code can be found here : http://sourcesup.cru.fr/projects/cas.net, sorry it is in French. I will work on a translation ASAP. I use this for web pages, I have not tried with web services. But it depends on your client scenario and the way you call web service. I guess that it should work in non soap scenario, like POX or REST. Jean Marie (jean-marie.thia at upmc dot fr) From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Juan Huerta Sent: mardi 27 novembre 2007 09:16 To: Yale CAS mailing list Subject: Re: C# Client Hi Paul, Im using your class and hope it works ... Well, basically this is what I hope it does: - An application is authenticated with CAS. In returns it gets a ticket. - This ticket is passed to other application, that will validate if the ticket is authenticated (using your class). If so ... it will continue. Well, this is what i think your class could help me out ... The class you provided, will return "failed" when using "String userName = client.Authenticate(ticket);" When calling manually the url https://casURL:8443/cas/proxyValidate?ticket=ST-3301-pq9Ron9TbuKayJHBclTZih6VkiARgfpndgZ-20&service=http://casService returns always: ticket 'ST-3301-pq9Ron9TbuKayJHBclTZih6VkiARgfpndgZ-20' not recognized I think it is related to the fact that the tickets are it is no longer recognized by CAS once, so, if it has been already validated it cant be reused again ... Are you able to trigger that pass a ticket from one application to other and get the user name of the user who "owns" that ticket? thanks a lot for your code, Juan 2007/9/3, Paul Hunnisett <[EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]>>: 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: [EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]> [mailto: [EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]>] 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 <[EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]>>: > > > 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: [EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]> > [mailto:[EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]>] 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 <[EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]>> > wrote: > > > > > > No-one able to tell me where to commit this or willing to review the code? > > > > ________________________________ > From: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > [mailto:[EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]>] 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 > > [email protected]<mailto:[email protected]> > > 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 > [email protected]<mailto:[email protected]> > http://tp.its.yale.edu/mailman/listinfo/cas > > _______________________________________________ Yale CAS mailing list [email protected]<mailto:[email protected]> 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 [email protected]<mailto:[email protected]> http://tp.its.yale.edu/mailman/listinfo/cas
_______________________________________________ Yale CAS mailing list [email protected] http://tp.its.yale.edu/mailman/listinfo/cas
