Massimo, Thanks for your reply now  I am working with new version 1.96.4 but
now as given in cas_auth.py

I have update my db.py with

from gluon.contrib.login_methods.cas_auth import CasAuth
auth.define_tables(username=True)
auth.settings.login_form=CasAuth(
urlbase = "http://127.0.0.1:8000/casapp2/default/user/cas
",actions=['login','validate','logout'])

still geting error:

Below is the tracebak

Traceback (most recent call last):
  File "D:\web2py_src_1.96.4\web2py\gluon\restricted.py", line 192, in
restricted
    exec ccode in environment
  File "D:/web2py_src_1.96.4/web2py/applications/casapp1/controllers/default.py"
<http://127.0.0.1:8000/admin/default/edit/casapp1/controllers/default.py>,
line 91, in <module>
  File "D:\web2py_src_1.96.4\web2py\gluon\globals.py", line 137, in <lambda>
    self._caller = lambda f: f()
  File "D:/web2py_src_1.96.4/web2py/applications/casapp1/controllers/default.py"
<http://127.0.0.1:8000/admin/default/edit/casapp1/controllers/default.py>,
line 53, in user
    return dict(form=auth())
  File "D:\web2py_src_1.96.4\web2py\gluon\tools.py", line 1069, in __call__
    return getattr(self,args[0])()
  File "D:\web2py_src_1.96.4\web2py\gluon\tools.py", line 1631, in login
    redirect(cas.login_url(next))
  File "D:\web2py_src_1.96.4\web2py\gluon\contrib\login_methods\cas_auth.py",
line 62, in login_url
    current.session.token=self._CAS_login()
  File "D:\web2py_src_1.96.4\web2py\gluon\contrib\login_methods\cas_auth.py",
line 116, in _CAS_login
    except ExpatError: pass
NameError: global name 'ExpatError' is not defined




---------- Forwarded message ----------
> From: Massimo Di Pierro <[email protected]>
> Date: Wed, Jun 22, 2011 at 8:38 PM
> Subject: [web2py] Re: Working with CAS
> To: web2py-users <[email protected]>
>
>
> From this error:
>
> giving me err in auth.settings.cas_domains.append
> AttributeError: 'NoneType' object has no attribute 'append'
>
> I believe you are running an old version of web2py that does not
> support the new CAS mechanism. Please try the latest one.
>
> On Jun 22, 9:50 am, sagar <[email protected]> wrote:
> > Hi
> >
> > I am trying to using use cas as given in online document
> >
> > when I  am using this :
> >
> > CAS.login_url='https://www.web2py.com/cas/cas/login'
> > CAS.check_url='https://www.web2py.com/cas/cas/check'
> > CAS.logout_url='https://www.web2py.com/cas/cas/logout'
> > CAS.my_url='http://127.0.0.1:8000/testauth/default/user/login'
> >
> > if not session.token and not request.function=='login':
> >     redirect(URL('login'))
> > def login():
> >     session.token=CAS.login(request)
> >     id,email,name=session.token
> >     return dict()
> > def logout():
> >     session.token=None
> >     CAS.logout()
> >
> > when i doing this come to know that
> > web2py app now has a built-in CAS consumer and provider
> >
> > while trying this(as per given there)
> >
> > auth.settings.cas_domains.append('http://consumer.com')
> > Consumer how to:
> > auth = Auth(db,cas_provider='http://provider.com/providerapp/default/
> > user/cas')
> >
> > giving me err in auth.settings.cas_domains.append
> >
> > AttributeError: 'NoneType' object has no attribute 'append'
> >
> > And while trying this one earliar from your post
> >
> > In app1 db.py
> > from gluon.contrib.login_methods.cas_auth import CasAuth
> > auth.define_tables(username=True)
> > auth.settings.login_form=CasAuth(globals(),urlbase = "http://
> > 127.0.0.1:8000/app2/default/user/login",
> > actions=['login','check','logout'])
> >
> > I got authenticated at app2 but not got redirected to app1.
> >
> > Please help How to get CAS working?
>
>

Reply via email to