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=\"&<>"'ZMR-Behoerdenabfrage_\">\n<param>\n<key>&GKZ</key><value>&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); }
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)); }
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)); }
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)); }