37 |
37 |
|
38 |
38 |
from authentic2.a2_rbac.models import OrganizationalUnit, Role
|
39 |
39 |
from authentic2.a2_rbac.utils import get_default_ou
|
|
40 |
from authentic2.custom_user.models import Profile, ProfileType
|
40 |
41 |
from authentic2.models import Attribute, AuthorizedRole
|
41 |
42 |
from authentic2.utils.misc import good_next_url, make_url
|
42 |
43 |
from authentic2_auth_oidc.utils import parse_timestamp
|
... | ... | |
751 |
752 |
response, 'consent_required', 'Consent is required but prompt parameter is "none"', message=False
|
752 |
753 |
)
|
753 |
754 |
|
|
755 |
# prompt is none, but account selection is required
|
|
756 |
oidc_client.activate_user_profiles = True
|
|
757 |
oidc_client.save()
|
|
758 |
profile_type_manager = ProfileType.objects.create(
|
|
759 |
name='One Manager Type',
|
|
760 |
slug='one-manager-type',
|
|
761 |
)
|
|
762 |
profile_type_delegate = ProfileType.objects.create(
|
|
763 |
name='One Delegate Type',
|
|
764 |
slug='one-delegate-type',
|
|
765 |
)
|
|
766 |
profile_manager = Profile.objects.create(
|
|
767 |
user=simple_user,
|
|
768 |
profile_type=profile_type_manager,
|
|
769 |
identifier='Entity 789',
|
|
770 |
email='manager@example789.org',
|
|
771 |
)
|
|
772 |
profile_delegate = Profile.objects.create(
|
|
773 |
user=simple_user,
|
|
774 |
profile_type=profile_type_delegate,
|
|
775 |
identifier='Entity 1011',
|
|
776 |
email='delegate@example1011.org',
|
|
777 |
)
|
|
778 |
response = app.get(
|
|
779 |
make_url(
|
|
780 |
'oidc-authorize',
|
|
781 |
params={
|
|
782 |
'client_id': oidc_client.client_id,
|
|
783 |
'redirect_uri': redirect_uri,
|
|
784 |
'response_type': response_type,
|
|
785 |
'scope': 'openid',
|
|
786 |
'prompt': 'none',
|
|
787 |
},
|
|
788 |
)
|
|
789 |
)
|
|
790 |
assert_authorize_error(
|
|
791 |
response,
|
|
792 |
'select_account_required',
|
|
793 |
'User profile selection is required but prompt parameter is "none"',
|
|
794 |
message=False,
|
|
795 |
)
|
|
796 |
profile_manager.delete()
|
|
797 |
profile_delegate.delete()
|
|
798 |
|
754 |
799 |
# user do not consent
|
755 |
800 |
response = app.get(
|
756 |
801 |
make_url(
|
757 |
|
-
|