diff --git a/src/authentic2_auth_fedict/authenticators.py b/src/authentic2_auth_fedict/authenticators.py index a18425d..b6b6115 100644 --- a/src/authentic2_auth_fedict/authenticators.py +++ b/src/authentic2_auth_fedict/authenticators.py @@ -44,6 +44,7 @@ class FedictAuthenticator(BaseAuthenticator): if request.method == 'POST' and submit_name in request.POST: return redirect_to_login(request, login_url='fedict-login') context['submit_name'] = submit_name + context.update(self.get_supported_methods()) return render(request, 'authentic2_auth_fedict/login.html', context) def profile(self, request, *args, **kwargs): @@ -52,4 +53,16 @@ class FedictAuthenticator(BaseAuthenticator): for user_saml_identifier in user_saml_identifiers: user_saml_identifier.idp = get_idp(user_saml_identifier.issuer) context['user_saml_identifiers'] = user_saml_identifiers + context.update(self.get_supported_methods()) return render_to_string('authentic2_auth_fedict/profile.html', context, request=request) + + def get_supported_methods(self): + try: + idp = [x for x in list(get_idps()) if 'belgium.be' in x.get('ENTITY_ID')][0] + authn_classref = idp['AUTHN_CLASSREF'] + except (IndexError, KeyError): + authn_classref = '' + return { + 'has_tokens': 'urn:be:fedict:iam:fas:citizen:token' in authn_classref, + 'has_itsme': 'urn:be:fedict:iam:fas:citizen:bmid' in authn_classref, + } diff --git a/src/authentic2_auth_fedict/static/authentic2_auth_fedict/img/beid-itsme.png b/src/authentic2_auth_fedict/static/authentic2_auth_fedict/img/beid-itsme.png new file mode 100644 index 0000000..bc88b30 Binary files /dev/null and b/src/authentic2_auth_fedict/static/authentic2_auth_fedict/img/beid-itsme.png differ diff --git a/src/authentic2_auth_fedict/templates/authentic2_auth_fedict/login.html b/src/authentic2_auth_fedict/templates/authentic2_auth_fedict/login.html index e65e918..2614274 100644 --- a/src/authentic2_auth_fedict/templates/authentic2_auth_fedict/login.html +++ b/src/authentic2_auth_fedict/templates/authentic2_auth_fedict/login.html @@ -1,11 +1,16 @@ {% load i18n static %}