0001-python3-make-OIDC-sub-generation-functions-return-te.patch
src/authentic2_idp_oidc/utils.py | ||
---|---|---|
123 | 123 |
def make_pairwise_unreversible_sub(client, user): |
124 | 124 |
sector_identifier = get_sector_identifier(client) |
125 | 125 |
sub = sector_identifier + str(user.uuid) + settings.SECRET_KEY |
126 |
sub = base64.b64encode(hashlib.sha256(sub).digest()) |
|
127 |
return sub |
|
126 |
sub = base64.b64encode(hashlib.sha256(sub.encode('utf-8')).digest())
|
|
127 |
return sub.decode('utf-8')
|
|
128 | 128 | |
129 | 129 | |
130 | 130 |
def make_pairwise_reversible_sub(client, user): |
... | ... | |
138 | 138 |
return None |
139 | 139 |
sector_identifier = get_sector_identifier(client) |
140 | 140 |
return crypto.aes_base64url_deterministic_encrypt( |
141 |
settings.SECRET_KEY, identifier, sector_identifier) |
|
141 |
settings.SECRET_KEY, identifier, sector_identifier).decode('utf-8')
|
|
142 | 142 | |
143 | 143 | |
144 | 144 |
def reverse_pairwise_sub(client, sub): |
145 |
- |