summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Vobornik <pvoborni@redhat.com>2016-06-30 19:16:32 +0200
committerMartin Basti <mbasti@redhat.com>2016-07-01 08:53:35 +0200
commit88f7154f7fcb1ca86dcbeeaca3c220ed4b88d55f (patch)
treed26c4bc70c8bedf2178a3f348bc87cea4ad04c1f
parentf5eb71f75e5e205674ed8df1e4c6324602fbe733 (diff)
downloadfreeipa-88f7154f7fcb1ca86dcbeeaca3c220ed4b88d55f.tar.gz
freeipa-88f7154f7fcb1ca86dcbeeaca3c220ed4b88d55f.tar.xz
freeipa-88f7154f7fcb1ca86dcbeeaca3c220ed4b88d55f.zip
webui: prevent infinite reload for users with krbbprincipal alias set
Web UI has inbuilt mechanism to reload in case response from a server contains a different principal than the one loaded during Web UI startup. see rpc.js:381 With kerberos aliases support the loaded principal could be different because krbprincipalname contained multiple values. In such case krbcanonicalname should be used - it contains the same principal as the one which will be in future API responses. https://fedorahosted.org/freeipa/ticket/5927 Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
-rw-r--r--install/ui/src/freeipa/ipa.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/install/ui/src/freeipa/ipa.js b/install/ui/src/freeipa/ipa.js
index 830def054..e8ad832c3 100644
--- a/install/ui/src/freeipa/ipa.js
+++ b/install/ui/src/freeipa/ipa.js
@@ -259,7 +259,11 @@ var IPA = function () {
},
on_success: function(data, text_status, xhr) {
that.whoami = batch ? data.result[0] : data.result.result[0];
- that.principal = that.whoami.krbprincipalname[0];
+ var cn = that.whoami.krbcanonicalname;
+ if (cn) that.principal = cn[0];
+ if (!that.principal) {
+ that.principal = that.whoami.krbprincipalname[0];
+ }
}
});
};