demand authorization get to verifier
This commit is contained in:
parent
cfbbaf491e
commit
5e95d6b15c
|
@ -2,7 +2,7 @@ import json
|
||||||
|
|
||||||
from django.views.generic.edit import View
|
from django.views.generic.edit import View
|
||||||
|
|
||||||
from oidc4vp.models import Authorization
|
from oidc4vp.models import Authorization, Organization
|
||||||
from django.http import HttpResponse
|
from django.http import HttpResponse
|
||||||
|
|
||||||
|
|
||||||
|
@ -11,36 +11,24 @@ from django.http import HttpResponse
|
||||||
|
|
||||||
# from utils.idhub_ssikit import verify_presentation
|
# from utils.idhub_ssikit import verify_presentation
|
||||||
# from oidc4vp.models import VPVerifyRequest
|
# from oidc4vp.models import VPVerifyRequest
|
||||||
# from django.shortcuts import get_object_or_404
|
from django.shortcuts import get_object_or_404
|
||||||
# from more_itertools import flatten, unique_everseen
|
# from more_itertools import flatten, unique_everseen
|
||||||
|
|
||||||
|
|
||||||
class VerifyView(View):
|
class VerifyView(View):
|
||||||
def get(self, request, *args, **kwargs):
|
def get(self, request, *args, **kwargs):
|
||||||
import pdb; pdb.set_trace()
|
org_url = request.GET.get('demand_uri')
|
||||||
res = json.dumps({"uri": "http://localhost:10000"})
|
org = get_object_or_404(Organization, response_uri=org_url)
|
||||||
return HttpResponse(res)
|
|
||||||
|
|
||||||
|
|
||||||
def DemandAuthorizationView(request):
|
|
||||||
assert request.method == "GET"
|
|
||||||
import pdb; pdb.set_trace()
|
|
||||||
params = request.GET.params
|
|
||||||
org = Organization.objects.filter(
|
|
||||||
url=params.get('redirect_uri')
|
|
||||||
)
|
|
||||||
authorization = Authorization(
|
authorization = Authorization(
|
||||||
organization=org,
|
organization=org,
|
||||||
presentation_definition="MemberCredential"
|
presentation_definition="MemberCredential"
|
||||||
)
|
)
|
||||||
# authorization.save()
|
import pdb; pdb.set_trace()
|
||||||
res = json.dumps({"uri": authorization.authorize()})
|
res = json.dumps({"redirect_uri": authorization.authorize()})
|
||||||
return HttpResponse(res)
|
return HttpResponse(res)
|
||||||
|
|
||||||
|
def post(self, request, *args, **kwargs):
|
||||||
def verify(request):
|
|
||||||
import pdb; pdb.set_trace()
|
import pdb; pdb.set_trace()
|
||||||
# assert request.method == "POST"
|
|
||||||
# # TODO: incorporate request.POST["presentation_submission"] as schema definition
|
# # TODO: incorporate request.POST["presentation_submission"] as schema definition
|
||||||
# (presentation_valid, _) = verify_presentation(request.POST["vp_token"])
|
# (presentation_valid, _) = verify_presentation(request.POST["vp_token"])
|
||||||
# if not presentation_valid:
|
# if not presentation_valid:
|
||||||
|
@ -76,4 +64,3 @@ def verify(request):
|
||||||
# raise Exception("Unknown action!")
|
# raise Exception("Unknown action!")
|
||||||
# # OK! Your verifiable presentation was successfully presented.
|
# # OK! Your verifiable presentation was successfully presented.
|
||||||
# return HttpResponseRedirect(vr.response_or_redirect)
|
# return HttpResponseRedirect(vr.response_or_redirect)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue