summaryrefslogtreecommitdiff
path: root/wrappers/python/eduvpncommon/auth.py
blob: b0d14106666eea762e8a385cd6212fbb819ecdfc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
from . import lib
from ctypes import *

def Register(name, url):
    name_bytes = name.encode('utf-8')
    url_bytes = url.encode('utf-8')
    lib.Register(name_bytes, url_bytes)

def InitializeOAuth():
    ptr = lib.InitializeOAuth()
    value = cast(ptr, c_char_p).value
    authURL = value.decode()
    lib.FreeString(ptr)
    return authURL