def authorization(self, request, **kwargs): areq = AuthorizationRequest().from_urlencoded(request) if not areq.verify(): raise OicMsgError() resp = HTTPResponse('OK') return resp
def test_verify(self): query = 'redirect_uri=http%3A%2F%2Flocalhost%3A8080%2Fauthz' \ '&response_type=code&client_id=0123456789' ar = AuthorizationRequest().deserialize(query, "urlencoded") assert ar.verify()
def test_urlencoded_missing_required(self): ar = AuthorizationRequest(response_type=["code"]) with pytest.raises(MissingRequiredAttribute): ar.verify()