I've started porting my apps away from pyramid_ldap to pyramid_cas  to rely 
on the university's CAS SSO and match other apps developed in-house by my 
department.

I started on a smaller app, and while the transition went fine, I am stuck 
with tests that cannot possibly pass or go on because as far as I can do, I 
can't get my test user recognized as logged in.

In normal usage, the way it works is : go to a restricted page => 
forbidden_view => redirect to SSO, login there => redirected back with a 
ticket => decode it => validate auth => view page. When testing, I can't 
just pass a random user/password to the external SSO and expect it to work, 
and using my own login/password is also out.

I tried the suggestions from 
https://docs.pylonsproject.org/projects/webtest/en/latest/testapp.html?highlight=authorization%20#modifying-the-environment-simulating-authentication,
 
tried setting the headers of a TestRequest.blank, but nothing works, I 
can't get the app to recognize my test user as authenticated, so it will 
try to redirect and fail not-gracefully. I could take a week or two and see 
if I can manage to run an ersatz of my university's CAS server using the 
docker image from Apereo, but I'd rather spend that time resting or working 
on proper projects ;p

I'm using Pyramid 1.10.8, yes I know I need to move on, but that's for 
later. What would the best way to test the parts of my app that require 
authentication without having to actually do a full CAS SSO authentication ?

RL

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pylons-discuss+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pylons-discuss/398de0ae-482c-4801-8159-30e8937f9475n%40googlegroups.com.

Reply via email to