File tree Expand file tree Collapse file tree 3 files changed +18
-2
lines changed
Expand file tree Collapse file tree 3 files changed +18
-2
lines changed Original file line number Diff line number Diff line change 1313use UnityWebPortal \lib \UnityRedis ;
1414use UnityWebPortal \lib \UnityWebhook ;
1515use UnityWebPortal \lib \UnityGithub ;
16+ use UnityWebPortal \lib \UnitySite ;
17+ use UnityWebPortal \lib \exceptions \SSOException ;
1618
1719//
1820// Initialize Session
9294// SSO Init
9395//
9496
95- $ SSO = UnitySSO::getSSO ();
97+ try {
98+ $ SSO = UnitySSO::getSSO ();
99+ } catch (SSOException $ e ) {
100+ $ errorid = uniqid ("sso- " );
101+ $ eppn = $ _SERVER ["REMOTE_USER " ];
102+ UnitySite::errorLog ("SSO Failure " , "{$ e } ( $ errorid) " );
103+ UnitySite::die ("Invalid eppn: ' $ eppn'. Please contact {$ CONFIG ["mail " ]["support " ]} (id: $ errorid) " , true );
104+ }
96105if (!is_null ($ SSO )) {
97106 // SSO is available
98107 $ _SESSION ["SSO " ] = $ SSO ;
Original file line number Diff line number Diff line change 33namespace UnityWebPortal \lib ;
44
55use Exception ;
6+ use UnityWebPortal \lib \exceptions \SSOException ;
67
78class UnitySSO
89{
@@ -17,7 +18,7 @@ private static function eppnToOrg($eppn)
1718 {
1819 $ parts = explode ("@ " , $ eppn );
1920 if (count ($ parts ) != 2 ) {
20- throw new Exception ("Malformed remote user detected: ' $ eppn' " );
21+ throw new SSOException ("Malformed remote user detected: ' $ eppn' " );
2122 }
2223
2324 $ org = $ parts [1 ];
Original file line number Diff line number Diff line change 1+ <?php
2+ namespace UnityWebPortal \lib \exceptions ;
3+
4+ class SSOException extends \Exception
5+ {
6+ }
You can’t perform that action at this time.
0 commit comments