Lines 39-45
Link Here
|
39 |
from univention.management.console.base import Base, UMC_Error, UMC_OptionSanitizeError |
39 |
from univention.management.console.base import Base, UMC_Error, UMC_OptionSanitizeError |
40 |
from univention.management.console.config import ucr |
40 |
from univention.management.console.config import ucr |
41 |
|
41 |
|
42 |
from univention.management.console.modules.decorators import sanitize, simple_response, file_upload |
42 |
from univention.management.console.modules.decorators import sanitize, simple_response, file_upload, allow_get |
43 |
from univention.management.console.modules.sanitizers import StringSanitizer, DictSanitizer, EmailSanitizer, ValidationError, MultiValidationError |
43 |
from univention.management.console.modules.sanitizers import StringSanitizer, DictSanitizer, EmailSanitizer, ValidationError, MultiValidationError |
44 |
|
44 |
|
45 |
from univention.googleapps.auth import GappsAuth, SCOPE, GoogleAppError, AuthenticationError, AuthenticationErrorRetry |
45 |
from univention.googleapps.auth import GappsAuth, SCOPE, GoogleAppError, AuthenticationError, AuthenticationErrorRetry |
Lines 84-93
def query(self):
Link Here
|
84 |
return { |
84 |
return { |
85 |
'initialized': GappsAuth.is_initialized(), |
85 |
'initialized': GappsAuth.is_initialized(), |
86 |
'sign-in-url': 'https://%s/simplesamlphp/saml2/idp/SSOService.php' % (sso_fqdn,), |
86 |
'sign-in-url': 'https://%s/simplesamlphp/saml2/idp/SSOService.php' % (sso_fqdn,), |
87 |
'sign-out-url': 'https://%s/simplesamlphp/saml2/idp/SingleLogoutService.php?ReturnTo=/ucs-overview' % (sso_fqdn,), |
87 |
'sign-out-url': 'https://%s/simplesamlphp/saml2/idp/SingleLogoutService.php?ReturnTo=/univention/' % (sso_fqdn,), |
88 |
'change-password-url': 'https://%s/univention-management-console/' % (fqdn,), |
88 |
'change-password-url': 'https://%s/univention/management/' % (fqdn,), |
89 |
} |
89 |
} |
90 |
|
90 |
|
|
|
91 |
@allow_get |
91 |
def certificate(self, request): |
92 |
def certificate(self, request): |
92 |
with open(ucr['saml/idp/certificate/certificate'], 'rb') as fd: |
93 |
with open(ucr['saml/idp/certificate/certificate'], 'rb') as fd: |
93 |
self.finished(request.id, fd.read(), mimetype='application/octet-stream') |
94 |
self.finished(request.id, fd.read(), mimetype='application/octet-stream') |
Lines 114-120
def upload(self, request):
Link Here
|
114 |
self.finished(request.id, { |
115 |
self.finished(request.id, { |
115 |
'client_id': data['client_id'], |
116 |
'client_id': data['client_id'], |
116 |
'scope': ','.join(SCOPE), |
117 |
'scope': ','.join(SCOPE), |
117 |
# 'serviceaccounts_link': 'https://console.developers.google.com/permissions/serviceaccounts?project=%s' % (urllib.quote(data['project_id']),) |
118 |
# 'serviceaccounts_link': 'https://console.developers.google.com/permissions/serviceaccounts?project=%s' % (urllib.quote(data['project_id']),) |
118 |
}, message=_('The credentials have been successfully uploaded.')) |
119 |
}, message=_('The credentials have been successfully uploaded.')) |
119 |
|
120 |
|
120 |
@simple_response |
121 |
@simple_response |