182 |
182 |
response = response.follow()
|
183 |
183 |
assert response.request.path == reverse('oidc-authorize')
|
184 |
184 |
if oidc_client.authorization_mode != OIDCClient.AUTHORIZATION_MODE_NONE:
|
185 |
|
assert 'a2-oidc-authorization-form' in response.content
|
|
185 |
assert 'a2-oidc-authorization-form' in response.text
|
186 |
186 |
assert OIDCAuthorization.objects.count() == 0
|
187 |
187 |
assert OIDCCode.objects.count() == 0
|
188 |
188 |
assert OIDCAccessToken.objects.count() == 0
|
... | ... | |
312 |
312 |
}
|
313 |
313 |
logout_url = make_url('oidc-logout', params=params)
|
314 |
314 |
response = app.get(logout_url)
|
315 |
|
assert 'You have been logged out' in response.content
|
316 |
|
assert 'https://example.com/?state=xyz' in response.content
|
|
315 |
assert 'You have been logged out' in response.text
|
|
316 |
assert 'https://example.com/?state=xyz' in response.text
|
317 |
317 |
assert '_auth_user_id' not in app.session
|
318 |
318 |
else:
|
319 |
319 |
response = app.get(make_url('account_management'))
|
... | ... | |
607 |
607 |
'prompt': 'consent',
|
608 |
608 |
})
|
609 |
609 |
response = app.get(authorize_url)
|
610 |
|
assert 'a2-oidc-authorization-form' in response.content
|
|
610 |
assert 'a2-oidc-authorization-form' in response.text
|
611 |
611 |
# check all authorization have been deleted, it's our policy
|
612 |
612 |
assert OIDCAuthorization.objects.count() == 0
|
613 |
613 |
if oidc_client.authorization_mode == oidc_client.AUTHORIZATION_MODE_NONE:
|
... | ... | |
619 |
619 |
authorize.expired = now() - datetime.timedelta(days=2)
|
620 |
620 |
authorize.save()
|
621 |
621 |
response = app.get(authorize_url)
|
622 |
|
assert 'a2-oidc-authorization-form' in response.content
|
|
622 |
assert 'a2-oidc-authorization-form' in response.text
|
623 |
623 |
authorize.expired = now() + datetime.timedelta(days=2)
|
624 |
624 |
authorize.scopes = 'openid profile'
|
625 |
625 |
authorize.save()
|
... | ... | |
810 |
810 |
|
811 |
811 |
# user not authorized
|
812 |
812 |
response = app.get(authorize_url)
|
813 |
|
assert 'https://example.com/southpark/' in response.content
|
|
813 |
assert 'https://example.com/southpark/' in response.text
|
814 |
814 |
|
815 |
815 |
# user authorized
|
816 |
816 |
simple_user.roles.add(role_authorized)
|
817 |
|
-
|