def setUp(self):
        call_command('creatersakey')
        self.factory = RequestFactory()
        self.user = create_fake_user()
        self.client_code_idtoken_token = create_fake_client(
            response_type='code id_token token', is_public=True)
        self.state = uuid.uuid4().hex
        self.nonce = uuid.uuid4().hex

        # Base data for the auth request.
        self.data = {
            'client_id':
            self.client_code_idtoken_token.client_id,
            'redirect_uri':
            self.client_code_idtoken_token.default_redirect_uri,
            'response_type':
            next(self.client_code_idtoken_token.response_type_values()),
            'scope':
            'openid email',
            'state':
            self.state,
            'nonce':
            self.nonce,
            'allow':
            'Accept',
        }
 def setUp(self):
     call_command('creatersakey')
     self.factory = RequestFactory()
     self.user = create_fake_user()
     self.client = create_fake_client(response_type='code')
     self.client_public = create_fake_client(response_type='code', is_public=True)
     self.state = uuid.uuid4().hex
     self.nonce = uuid.uuid4().hex
 def setUp(self):
     call_command('creatersakey')
     self.factory = RequestFactory()
     self.user = create_fake_user()
     self.client = create_fake_client(response_type='code')
     self.client_public = create_fake_client(response_type='code', is_public=True)
     self.state = uuid.uuid4().hex
     self.nonce = uuid.uuid4().hex
 def setUp(self):
     call_command("creatersakey")
     self.factory = RequestFactory()
     self.user = create_fake_user()
     self.client = create_fake_client(response_type="id_token token")
     self.client_public = create_fake_client(response_type="id_token token", is_public=True)
     self.client_no_access = create_fake_client(response_type="id_token")
     self.client_public_no_access = create_fake_client(response_type="id_token", is_public=True)
     self.state = uuid.uuid4().hex
     self.nonce = uuid.uuid4().hex
Esempio n. 5
0
    def setUp(self):
        call_command('creatersakey')
        self.user = create_fake_user()

        self.oidc_client = create_fake_client('id_token')
        self.LOGOUT_URL = 'http://example.com/logged-out/'
        self.oidc_client.post_logout_redirect_uris = [self.LOGOUT_URL]
        self.oidc_client.save()

        self.url = reverse('oidc_provider:end-session')
    def setUp(self):
        url = reverse('oidc_provider:authorize')
        user = create_fake_user()
        client = create_fake_client(response_type='code', is_public=True)

        # Base data to create a uri response
        data = {
            'client_id': client.client_id,
            'redirect_uri': client.default_redirect_uri,
            'response_type': next(client.response_type_values()),
        }

        factory = RequestFactory()
        self.request = factory.post(url, data=data)
        self.request.user = user
 def setUp(self):
     call_command('creatersakey')
     self.factory = RequestFactory()
     self.user = create_fake_user()
     self.client = create_fake_client(response_type='id_token token')
     self.client_public = create_fake_client(response_type='id_token token', is_public=True)
     self.client_public_no_consent = create_fake_client(
         response_type='id_token token', is_public=True,
         require_consent=False)
     self.client_no_access = create_fake_client(response_type='id_token')
     self.client_public_no_access = create_fake_client(response_type='id_token', is_public=True)
     self.client_multiple_response_types = create_fake_client(
         response_type=('id_token', 'id_token token'))
     self.state = uuid.uuid4().hex
     self.nonce = uuid.uuid4().hex
Esempio n. 8
0
 def setUp(self):
     call_command('creatersakey')
     self.factory = RequestFactory()
     self.user = create_fake_user()
     self.client = create_fake_client(response_type='id_token token')
     self.client_public = create_fake_client(response_type='id_token token', is_public=True)
     self.client_public_no_consent = create_fake_client(
         response_type='id_token token', is_public=True,
         require_consent=False)
     self.client_no_access = create_fake_client(response_type='id_token')
     self.client_public_no_access = create_fake_client(response_type='id_token', is_public=True)
     self.client_multiple_response_types = create_fake_client(
         response_type=('id_token', 'id_token token'))
     self.state = uuid.uuid4().hex
     self.nonce = uuid.uuid4().hex
Esempio n. 9
0
    def setUp(self):
        url = reverse('oidc_provider:authorize')
        user = create_fake_user()
        client = create_fake_client(response_type='code', is_public=True)

        # Base data to create a uri response
        data = {
            'client_id': client.client_id,
            'redirect_uri': client.default_redirect_uri,
            'response_type': next(client.response_type_values()),
        }

        factory = RequestFactory()
        self.request = factory.post(url, data=data)
        self.request.user = user
 def setUp(self):
     call_command('creatersakey')
     self.factory = RequestFactory()
     self.user = create_fake_user()
     self.aud = 'testaudience'
     self.client = create_fake_client(response_type='id_token token')
     self.resource = create_fake_client(response_type='id_token token')
     self.resource.scope = ['token_introspection', self.aud]
     self.resource.save()
     self.token = create_fake_token(self.user, self.client.scope, self.client)
     self.token.access_token = str(random.randint(1, 999999)).zfill(6)
     self.now = time.time()
     with patch('oidc_provider.lib.utils.token.time.time') as time_func:
         time_func.return_value = self.now
         self.token.id_token = create_id_token(self.token, self.user, self.aud)
     self.token.save()
    def setUp(self):
        call_command("creatersakey")
        self.factory = RequestFactory()
        self.user = create_fake_user()
        self.client_code_idtoken_token = create_fake_client(response_type="code id_token token", is_public=True)
        self.state = uuid.uuid4().hex
        self.nonce = uuid.uuid4().hex

        # Base data for the auth request.
        self.data = {
            "client_id": self.client_code_idtoken_token.client_id,
            "redirect_uri": self.client_code_idtoken_token.default_redirect_uri,
            "response_type": self.client_code_idtoken_token.response_type,
            "scope": "openid email",
            "state": self.state,
            "nonce": self.nonce,
            "allow": "Accept",
        }
Esempio n. 12
0
 def setUp(self):
     call_command('creatersakey')
     self.factory = RequestFactory()
     self.user = create_fake_user()
     self.aud = 'testaudience'
     self.client = create_fake_client(response_type='id_token token')
     self.resource = create_fake_client(response_type='id_token token')
     self.resource.scope = ['token_introspection', self.aud]
     self.resource.save()
     self.token = create_fake_token(self.user, self.client.scope,
                                    self.client)
     self.token.access_token = str(random.randint(1, 999999)).zfill(6)
     self.now = time.time()
     with patch('oidc_provider.lib.utils.token.time.time') as time_func:
         time_func.return_value = self.now
         self.token.id_token = create_id_token(self.token, self.user,
                                               self.aud)
     self.token.save()
    def setUp(self):
        call_command('creatersakey')
        self.factory = RequestFactory()
        self.user = create_fake_user()
        self.client_code_idtoken_token = create_fake_client(
            response_type='code id_token token', is_public=True)
        self.state = uuid.uuid4().hex
        self.nonce = uuid.uuid4().hex

        # Base data for the auth request.
        self.data = {
            'client_id': self.client_code_idtoken_token.client_id,
            'redirect_uri': self.client_code_idtoken_token.default_redirect_uri,
            'response_type': next(self.client_code_idtoken_token.response_type_values()),
            'scope': 'openid email',
            'state': self.state,
            'nonce': self.nonce,
            'allow': 'Accept',
        }
 def setUp(self):
     self.factory = RequestFactory()
     self.user = create_fake_user()
     self.client = create_fake_client(response_type='code')
 def setUp(self):
     self.user = create_fake_user()
Esempio n. 16
0
 def setUp(self):
     self.user = create_fake_user()
Esempio n. 17
0
 def setUp(self):
     call_command('creatersakey')
     self.factory = RequestFactory()
     self.user = create_fake_user()
     self.client = create_fake_client(response_type='code')
 def setUp(self):
     self.user = create_fake_user()
     self.scopes = ['openid', 'address', 'email', 'phone', 'profile']
     self.client = create_fake_client('code')
     self.token = create_fake_token(self.user, self.scopes, self.client)
     self.scopeClaims = ScopeClaims(self.token)
Esempio n. 19
0
 def setUp(self):
     self.user = create_fake_user()
     self.scopes = ['openid', 'address', 'email', 'phone', 'profile']
     self.client = create_fake_client('code')
     self.token = create_fake_token(self.user, self.scopes, self.client)
     self.scopeClaims = ScopeClaims(self.token)
 def setUp(self):
     self.user = create_fake_user()
     self.url = reverse('oidc_provider:logout')
Esempio n. 21
0
 def setUp(self):
     self.factory = RequestFactory()
     self.user = create_fake_user()
     self.client = create_fake_client(response_type='code')
     self.url = reverse('oidc_provider:userinfo')
Esempio n. 22
0
 def setUp(self):
     self.user = create_fake_user()
     self.scopes = ['openid', 'address', 'email', 'phone', 'profile']
     self.scopeClaims = ScopeClaims(self.user, self.scopes)
 def setUp(self):
     self.factory = RequestFactory()
     self.user = create_fake_user()
     self.client = create_fake_client(response_type='code')
 def setUp(self):
     self.user = create_fake_user()
     self.url = reverse('oidc_provider:logout')
 def setUp(self):
     call_command('creatersakey')
     self.factory = RequestFactory()
     self.user = create_fake_user()
     self.client = create_fake_client(response_type='code')
Esempio n. 26
0
 def setUp(self):
     self.user = create_fake_user()
     self.scopes = ["openid", "address", "email", "phone", "profile", "foo"]
     self.client = create_fake_client("code")
     self.token = create_fake_token(self.user, self.scopes, self.client)
     self.scopeClaims = ScopeClaims(self.token)