-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathauth.py
More file actions
37 lines (25 loc) · 692 Bytes
/
auth.py
File metadata and controls
37 lines (25 loc) · 692 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import jwt
#TODO: Change and remove secret after local development
secrret_key = 'feY5QNYQVMItpPTWq8o7cZbgh9vxqlGuOOCA'
def genAccessToken():
# TODO Define needed Claims
issuer = 'ylka.c-pohl.de'
subject = 'the_user'
audience = 'users'
expiration = 'time???'
issued_at = 'time_at_issue'
payload = {
'iss': issuer,
'sub': subject,
'aud': audience,
'exp': expiration,
'iat': issued_at
}
encoded_jwt = jwt.encode(payload, secrret_key, algorithm="HS256")
return encoded_jwt
def genRefreshToken():
# TODO: define Claims and Workflow for refreshing
pass
def authToken():
jwt.decode()
pass