Bugzilla – Attachment 143406 Details for
Bug 31378
Add a generic OAuth2/OIDC client implementation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31378: Add OPAC support for authentication providers
Bug-31378-Add-OPAC-support-for-authentication-prov.patch (text/plain), 8.51 KB, created by
Tomás Cohen Arazi (tcohen)
on 2022-11-08 14:52:47 UTC
(
hide
)
Description:
Bug 31378: Add OPAC support for authentication providers
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2022-11-08 14:52:47 UTC
Size:
8.51 KB
patch
obsolete
>From 0b5879350e6bfaeb538755b9408eda88b2e501cd Mon Sep 17 00:00:00 2001 >From: Agustin Moyano <agustinmoyano@theke.io> >Date: Tue, 23 Aug 2022 12:00:47 -0300 >Subject: [PATCH] Bug 31378: Add OPAC support for authentication providers > >Signed-off-by: Lukasz Koszyk <lukasz.koszyk@kit.edu> >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > .../bootstrap/en/includes/masthead.inc | 18 +++++++++++++ > .../bootstrap/en/modules/opac-auth.tt | 26 +++++++++++++++++++ > .../bootstrap/en/modules/opac-main.tt | 18 +++++++++++++ > 3 files changed, 62 insertions(+) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc >index 8c3e8575a7a..f8c97c1780c 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc >@@ -2,6 +2,7 @@ > [% USE Koha %] > [% USE Branches %] > [% USE Categories %] >+[% USE AuthClient %] > [% USE AdditionalContents %] > [% PROCESS 'html_helpers.inc' %] > [% SET OpacLangSelectorMode = Koha.Preference('OpacLangSelectorMode') %] >@@ -384,6 +385,23 @@ > [% END %] > [% END %] > [% UNLESS Koha.Preference('opacShibOnly') %] >+ [% SET auth_providers = AuthClient.get_providers('opac') %] >+ [% IF ( ! auth_providers.empty ) %] >+ [% FOREACH provider IN auth_providers %] >+ <p class="clearfix"> >+ <a href="[% provider.url | url %]" class="btn btn-light col-md-12" id="provider_[% provider.code | html %]"> >+ [% IF provider.icon_url %] >+ <img src="[% provider.icon_url | url %]" /> >+ [% ELSE %] >+ <i class="fa fa-user" aria-hidden="true"></i> >+ [% END %] >+ Log in with [% provider.description | html %] >+ </a> >+ </p> >+ [% END %] >+ <hr/> >+ <p>If you do not have an external account, but do have a local account, you can still log in: </p> >+ [% END # /IF auth_providers.size %] > <input type="hidden" name="koha_login_context" value="opac" /> > <fieldset class="brief"> > <div class="local-login"> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth.tt >index 62a8ee03ed4..c9be3125fd4 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth.tt >@@ -2,6 +2,7 @@ > [% USE Koha %] > [% USE Categories %] > [% USE AdditionalContents %] >+[% USE AuthClient %] > [% PROCESS 'html_helpers.inc' %] > [% SET OpacLoginInstructions = AdditionalContents.get( location => "OpacLoginInstructions", lang => lang, library => branchcode || default_branch ) %] > [% INCLUDE 'doc-head-open.inc' %] >@@ -76,6 +77,13 @@ > </div> > [% END %] > >+ [% IF auth_error %] >+ <div class="alert alert-info"> >+ <p>There was an error authenticating to external identity provider</p> >+ <p>[% auth_error | html %]</p> >+ </div> >+ [% END %] >+ > [% IF ( shibbolethAuthentication ) %] > [% IF ( invalidShibLogin ) %] > <!-- This is what is displayed if shibboleth login has failed to match a koha user --> >@@ -155,6 +163,24 @@ > > [% END # / IF casAuthentication %] > >+ [% SET auth_providers = AuthClient.get_providers('opac') %] >+ [% IF ( ! auth_providers.empty ) %] >+ [% FOREACH provider IN auth_providers %] >+ <p class="clearfix"> >+ <a href="[% provider.url | url %]" class="btn btn-light col-md-12" id="provider_[% provider.code | html %]"> >+ [% IF provider.icon_url %] >+ <img src="[% provider.icon_url | url %]" style="max-height: 20px; max-width: 20px;"/> >+ [% ELSE %] >+ <i class="fa fa-user" aria-hidden="true"></i> >+ [% END %] >+ Log in with [% provider.description | html %] >+ </a> >+ </p> >+ [% END %] >+ <hr/> >+ <p>If you do not have an external account, but do have a local account, you can still log in: </p> >+ [% END # /IF auth_providers %] >+ > [% IF ( Koha.Preference('GoogleOpenIDConnect') == 1 ) %] > [% IF ( invalidGoogleOpenIDConnectLogin ) %] > <h2>Google login</h2> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt >index 3d7f3f41254..fabd4e8df30 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt >@@ -5,6 +5,7 @@ > [% USE Categories %] > [% USE Price %] > [% USE AdditionalContents %] >+[% USE AuthClient %] > [% PROCESS 'i18n.inc' %] > [% SET OpacNav = AdditionalContents.get( location => "OpacNav", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %] > [% SET OpacNavBottom = AdditionalContents.get( location => "OpacNavBottom", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %] >@@ -191,6 +192,23 @@ > <a href="/cgi-bin/koha/svc/auth/googleopenidconnect" class="btn btn-light" id="openid_connect"><i class="fa fa-google" aria-hidden="true"></i> Log in with Google</a> > <p>If you do not have a Google account, but do have a local account, you can still log in: </p> > [% END # /IF GoogleOpenIDConnect %] >+ [% SET auth_providers = AuthClient.get_providers('opac') %] >+ [% IF ( ! auth_providers.empty ) %] >+ [% FOREACH provider IN auth_providers %] >+ <p class="clearfix"> >+ <a href="[% provider.url | url %]" class="btn btn-light col-md-12" id="provider_[% provider.code | html %]"> >+ [% IF provider.icon_url %] >+ <img src="[% provider.icon_url | url %]" style="max-height: 20px; max-width: 20px;"/> >+ [% ELSE %] >+ <i class="fa fa-user" aria-hidden="true"></i> >+ [% END %] >+ Log in with [% provider.description | html %] >+ </a> >+ </p> >+ [% END %] >+ <hr/> >+ <p>If you do not have an external account, but do have a local account, you can still log in: </p> >+ [% END # /IF auth_providers.size %] > <div class="local-login"> > <label for="userid">Login:</label> > <input class="form-control" type="text" id="userid" name="userid" autocomplete="off" /> >-- >2.34.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 31378
:
141362
|
141363
|
141364
|
141365
|
141366
|
141367
|
141368
|
141369
|
141370
|
141371
|
141372
|
141373
|
141374
|
141375
|
141376
|
141377
|
141378
|
141514
|
141771
|
141772
|
141773
|
141774
|
141775
|
141776
|
141777
|
141778
|
141779
|
141780
|
141781
|
141782
|
141783
|
141784
|
141785
|
141786
|
141787
|
141788
|
141801
|
141802
|
141803
|
141804
|
141805
|
141806
|
141807
|
141808
|
141809
|
141810
|
141811
|
141812
|
141813
|
141814
|
141815
|
141816
|
141817
|
141818
|
141853
|
143056
|
143087
|
143088
|
143089
|
143090
|
143091
|
143092
|
143093
|
143094
|
143095
|
143096
|
143097
|
143098
|
143099
|
143100
|
143101
|
143102
|
143103
|
143104
|
143105
|
143106
|
143107
|
143186
|
143187
|
143188
|
143189
|
143190
|
143191
|
143192
|
143193
|
143194
|
143195
|
143196
|
143197
|
143198
|
143199
|
143200
|
143202
|
143204
|
143205
|
143206
|
143207
|
143208
|
143215
|
143216
|
143217
|
143218
|
143219
|
143220
|
143221
|
143222
|
143223
|
143224
|
143225
|
143226
|
143227
|
143228
|
143229
|
143230
|
143231
|
143232
|
143233
|
143234
|
143235
|
143236
|
143266
|
143267
|
143268
|
143269
|
143270
|
143271
|
143272
|
143273
|
143274
|
143275
|
143277
|
143278
|
143279
|
143280
|
143281
|
143282
|
143283
|
143284
|
143285
|
143286
|
143287
|
143288
|
143396
|
143397
|
143398
|
143399
|
143400
|
143401
|
143402
|
143403
|
143404
|
143405
|
143406
|
143407
|
143408
|
143409
|
143410
|
143411
|
143412
|
143413
|
143414
|
143415
|
143416
|
143417
|
143418
|
143420
|
143421
|
143422
|
143423
|
143424
|
143425
|
143426
|
143427
|
143428
|
143429
|
143430
|
143431
|
143432
|
143433
|
143434
|
143435
|
143436
|
143437
|
143438
|
143439
|
143440
|
143441
|
143442
|
143443
|
143450
|
144071
|
144175