From 28f7b678d7e866f7bbe12162fd182c9322442312 Mon Sep 17 00:00:00 2001 From: Phil Elson Date: Tue, 2 Mar 2021 17:56:46 +0100 Subject: [PATCH] Address remaining review actions. --- .gitlab-ci.yml | 2 ++ app-config/auth-service/auth_service/__init__.py | 3 +-- cara/apps/templates/layout.html.j2 | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 746ab680..9c35bba5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -27,6 +27,7 @@ trigger_build_on_openshift: - curl -X POST -k https://openshift.cern.ch:443/apis/build.openshift.io/v1/namespaces/cara/buildconfigs/cara-app/webhooks/${OPENSHIFT_BUILD_WEBHOOK_SECRET}/generic - curl -X POST -k https://openshift.cern.ch:443/apis/build.openshift.io/v1/namespaces/cara/buildconfigs/cara-router/webhooks/${OPENSHIFT_BUILD_WEBHOOK_SECRET}/generic - curl -X POST -k https://openshift.cern.ch:443/apis/build.openshift.io/v1/namespaces/cara/buildconfigs/cara-webservice/webhooks/${OPENSHIFT_BUILD_WEBHOOK_SECRET}/generic + - curl -X POST -k https://openshift.cern.ch:443/apis/build.openshift.io/v1/namespaces/cara/buildconfigs/auth-service/webhooks/${OPENSHIFT_BUILD_WEBHOOK_SECRET}/generic deploy_to_test: @@ -37,3 +38,4 @@ deploy_to_test: - curl -X POST -k https://openshift-dev.cern.ch:443/apis/build.openshift.io/v1/namespaces/test-cara/buildconfigs/cara-app/webhooks/${OPENSHIFT_TEST_BUILD_WEBHOOK_SECRET}/generic - curl -X POST -k https://openshift-dev.cern.ch:443/apis/build.openshift.io/v1/namespaces/test-cara/buildconfigs/cara-router/webhooks/${OPENSHIFT_TEST_BUILD_WEBHOOK_SECRET}/generic - curl -X POST -k https://openshift-dev.cern.ch:443/apis/build.openshift.io/v1/namespaces/test-cara/buildconfigs/cara-webservice/webhooks/${OPENSHIFT_TEST_BUILD_WEBHOOK_SECRET}/generic + - curl -X POST -k https://openshift-dev.cern.ch:443/apis/build.openshift.io/v1/namespaces/test-cara/buildconfigs/auth-service/webhooks/${OPENSHIFT_TEST_BUILD_WEBHOOK_SECRET}/generic diff --git a/app-config/auth-service/auth_service/__init__.py b/app-config/auth-service/auth_service/__init__.py index 501c3926..d669f742 100644 --- a/app-config/auth-service/auth_service/__init__.py +++ b/app-config/auth-service/auth_service/__init__.py @@ -82,13 +82,12 @@ class Authorization(BaseHandler, OIDCClientMixin): # url that was tracked in the browser devtools). self.finish('Error logging in. Would you like to try again?') - LOG.info(f'Fetching user info') user_info = await oidc_cli.userinfo(result['access_token'] or '') session_data = { 'refresh_token': result['refresh_token'], - 'username': user_info['preferred_username'], + 'username': user_info.get('preferred_username', user_info['email']), 'fullname': user_info['name'], 'email': user_info['email'], } diff --git a/cara/apps/templates/layout.html.j2 b/cara/apps/templates/layout.html.j2 index 334b8f6d..04448fa3 100644 --- a/cara/apps/templates/layout.html.j2 +++ b/cara/apps/templates/layout.html.j2 @@ -68,7 +68,9 @@
  • Signed in as: +