From ed5fd3dafd007dc63f6c358da9c5f70909d372e0 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Wed, 20 Apr 2022 13:24:00 +0100 Subject: [PATCH] Implement getting the authentication link --- handler/ux/verify.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/handler/ux/verify.py b/handler/ux/verify.py index 6114aab..2ddd670 100644 --- a/handler/ux/verify.py +++ b/handler/ux/verify.py @@ -19,6 +19,16 @@ class Verify(util.Base): """ Get an external authentication link for a user. """ + # /resources/sdkIntegrations/levels/{levelName}/websdkLink?ttlInSecs={lifetime}&externalUserId={externalUserId}&lang={locale} + url = ( + f"{settings.Verify.Base}/resources/sdkIntegrations/levels/{settings.Verify.LevelName}" + f"/websdkLink?ttlInSecs=36000&externalUserId={external_user_id}" + ) + resp = self.sign_request(requests.Request("POST", url)) + s = requests.Session() + response = s.send(resp) + verification_url = response.json()["url"] + return verification_url def get_applicant_status(self, applicant_id): """