bugfixes
This commit is contained in:
parent
7a796825d0
commit
986be944fd
9
import.py
Normal file
9
import.py
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
import logging
|
||||||
|
from lenticular_cloud.app import oidc_provider_init_app
|
||||||
|
|
||||||
|
name = 'oidc_provider'
|
||||||
|
app = oidc_provider_init_app(name)
|
||||||
|
logging.basicConfig(level=logging.DEBUG)
|
||||||
|
|
||||||
|
with app.context():
|
||||||
|
|
|
@ -254,6 +254,8 @@ class User(EntryBase):
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def email(self):
|
def email(self):
|
||||||
|
domain = current_app.config['DOMAIN']
|
||||||
|
return f'{self.username}@{domain}'
|
||||||
return self._ldap_object.mail
|
return self._ldap_object.mail
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
|
@ -38,9 +38,10 @@ def consent():
|
||||||
requested_audiences = consent_request.requested_access_token_audience
|
requested_audiences = consent_request.requested_access_token_audience
|
||||||
|
|
||||||
if form.validate_on_submit() or consent_request.skip:
|
if form.validate_on_submit() or consent_request.skip:
|
||||||
|
user = User.query.get(consent_request.subject)
|
||||||
token_data = {
|
token_data = {
|
||||||
'preferred_username': str(current_user.username),
|
'preferred_username': str(user.username),
|
||||||
'email': str(current_user.email),
|
'email': str(user.email),
|
||||||
'email_verified': True,
|
'email_verified': True,
|
||||||
}
|
}
|
||||||
id_token_data = {}
|
id_token_data = {}
|
||||||
|
|
Loading…
Reference in a new issue