Exemple #1
0
        public void AuthorizationSimple()
        {
            PvpApplicationLdapAuthorizer authorizer = new PvpApplicationLdapAuthorizer("http://test.rubicon-it.com",
                                                                                       @"egora1");

            Assert.IsNotNull(authorizer);
            Assert.IsTrue(authorizer.IsValid);
            var fragment = authorizer.UserPrincipalSoapFragment;
            var ns       = new XmlNamespaceManager(new NameTable());

            ns.AddNamespace("pvp", PvpToken.PvpTokenNamespace);
            var userId = fragment.SelectSingleNode("//pvp:userId", ns);

            Assert.AreEqual("*****@*****.**", userId.InnerText);
            Assert.AreEqual("*****@*****.**", authorizer.Mail, "MailAddress");
            Assert.AreEqual("&<>\"'ZMR-Behoerdenabfrage_(&GKZ=&1234)", authorizer.Roles, "Roles");
            Assert.AreEqual("Vienna", authorizer.CostCenterId);
            Assert.AreEqual("egora/Development", authorizer.ChargeCode);
            Assert.AreEqual(600, authorizer.AuthorizationTimeToLive, "TimeToLive");
            Assert.AreEqual(
                "<role value=\"&amp;&lt;&gt;&quot;&apos;ZMR-Behoerdenabfrage_\">\n<param>\n<key>&amp;GKZ</key><value>&amp;1234</value>\n</param>\n</role>",
                authorizer.GetPvpToken().RoleAttribute.GetXmlPart(), "SoapRoles");
            Assert.IsTrue(authorizer.GetAttributeValue(PvpAttributes.X_AUTHENTICATE_cn).EndsWith(" through formatter"));
            Assert.AreEqual("1.8", authorizer.Version);
        }
Exemple #2
0
        public void OuPathSourceTest()
        {
            PvpApplicationLdapAuthorizer authorizer = new PvpApplicationLdapAuthorizer("http://test.rubicon-it.com",
                                                                                       @"rubicon\bmi-pvp-user-1");

            Assert.AreEqual("Vienna", authorizer.GetAttributeValue(PvpAttributes.COST_CENTER_ID));
        }
Exemple #3
0
        public void OuPathFormatterTest()
        {
            PvpApplicationLdapAuthorizer authorizer = new PvpApplicationLdapAuthorizer("http://test.rubicon-it.com",
                                                                                       @"rubicon\bmi-pvp-user-1");

            Assert.AreEqual("ServiceUser/egora/Development", authorizer.GetAttributeValue(PvpAttributes.CHARGE_CODE));
        }
Exemple #4
0
        public void AdditionalAttribute()
        {
            PvpApplicationLdapAuthorizer authorizer = new PvpApplicationLdapAuthorizer("http://test.rubicon-it.com",
                                                                                       @"egora.drei");

            Assert.AreEqual("egora Drei through formatter", authorizer.GetAttributeValue(PvpAttributes.X_AUTHENTICATE_cn));
        }