34 |
34 |
|
35 |
35 |
resp = get_app(pub).get('/test/auth')
|
36 |
36 |
assert resp.location == 'http://example.net/login/?ReturnUrl=http%3A//example.net/test/'
|
|
37 |
resp = get_app(pub).get('/test/auth?param1=foo¶m2=bar')
|
|
38 |
assert (
|
|
39 |
resp.location
|
|
40 |
== 'http://example.net/login/?ReturnUrl=http%3A//example.net/test/%3Fparam1%3Dfoo%26param2%3Dbar'
|
|
41 |
)
|
37 |
42 |
|
38 |
|
resp = login(get_app(pub), username='foo', password='foo').get('/test/auth')
|
|
43 |
app = login(get_app(pub), username='foo', password='foo')
|
|
44 |
resp = app.get('/test/auth')
|
39 |
45 |
assert resp.location == 'http://example.net/test/'
|
|
46 |
resp = app.get('/test/auth?param1=foo¶m2=bar')
|
|
47 |
assert resp.location == 'http://example.net/test/?param1=foo¶m2=bar'
|
40 |
48 |
|
41 |
49 |
|
42 |
50 |
def test_form_tryauth(pub, formdef):
|
... | ... | |
44 |
52 |
|
45 |
53 |
resp = get_app(pub).get('/test/tryauth')
|
46 |
54 |
assert resp.location == 'http://example.net/test/'
|
|
55 |
resp = get_app(pub).get('/test/tryauth?param1=foo¶m2=bar')
|
|
56 |
assert resp.location == 'http://example.net/test/?param1=foo¶m2=bar'
|
47 |
57 |
|
48 |
58 |
app = login(get_app(pub), username='foo', password='foo')
|
49 |
59 |
pub.cfg['identification'] = {'methods': ['idp']}
|
... | ... | |
51 |
61 |
# if the user is logged in, the form should be presented
|
52 |
62 |
resp = app.get('/test/tryauth')
|
53 |
63 |
assert resp.location == 'http://example.net/test/'
|
|
64 |
resp = app.get('/test/tryauth?param1=foo¶m2=bar')
|
|
65 |
assert resp.location == 'http://example.net/test/?param1=foo¶m2=bar'
|
54 |
66 |
|
55 |
67 |
# if the user is unlogged, there should be a passive redirection to SSO
|
56 |
68 |
resp = get_app(pub).get('/test/tryauth')
|
... | ... | |
64 |
76 |
create_user(pub)
|
65 |
77 |
|
66 |
78 |
resp = get_app(pub).get('/test/forceauth')
|
67 |
|
assert resp.location == 'http://example.net/login/?ReturnUrl=http%3A//example.net/test/&forceAuthn=true'
|
|
79 |
assert resp.location == (
|
|
80 |
'http://example.net/login/' '?ReturnUrl=http%3A//example.net/test/&forceAuthn=true'
|
|
81 |
)
|
|
82 |
resp = get_app(pub).get('/test/forceauth?param1=foo¶m2=bar')
|
|
83 |
assert resp.location == (
|
|
84 |
'http://example.net/login/'
|
|
85 |
'?ReturnUrl=http%3A//example.net/test/%3Fparam1%3Dfoo%26param2%3Dbar&forceAuthn=true'
|
|
86 |
)
|