Authorization and Profile Application Blocks
-
Hi We are using Authorization and profile application blocks (Microsoft Design patterns).We are trying to access the Azman Provider we are not able to access the dll which is added in the references already in the client application.If you can provide us some code snippets that would be really very helpful.I am providing my client application here. *******************Code********************* using System; using System.Collections; using System.ComponentModel; using System.Data; using System.Drawing; using System.Web; using System.Web.SessionState; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; //Error ,in accessing the reference that is added using Microsoft.ApplicationBlocks.Security.Provider; //cannot access the provider. using Microsoft.ApplicationBlocks.Security.Authorization; using Microsoft.ApplicationBlocks.Security.Profile; using Microsoft.ApplicationBlocks.Common.Crypto; using System.Security.Principal; using System.Configuration.Assemblies; using System.Threading; using Microsoft.Interop.Security.AzRoles; namespace myClient { public class WebForm1 : System.Web.UI.Page { string userRole="Manager"; private void Page_Load(object sender, System.EventArgs e) { Microsoft.ApplicationBlocks.Security.ExtendedPrincipal principal = Microsoft.ApplicationBlocks.Security.ExtendedPrincipal.Create(Thread.CurrentPrincipal.Identity); Thread.CurrentPrincipal =principal; principal.AuditIdentifier ="MyAuditIdentifer"; principal.AuthorizationProvider="azmanProvider"; principal.AuthorizationParameters.Add(AzManProvider.ApplicationName,"myApplication"); if(Thread.CurrentPrincipal.IsInRole(userRole)) { ((ExtendedPrincipal)Thread.CurrentPrincipal).AuthorizationParameters.Add("tasks",new string[1] {"AddOrderTask"}); if ( ((ExtendedPrincipal)Thread.CurrentPrincipal).CheckAccess()) { //quickStart.AddOrder(); } else { Response.Write("Add Order Access Denied"); } } Hashtable parameters = new Hashtable(5); parameters.Add("principal",Thread.CurrentPrincipal); ((ProfileCollection)((ExtendedPrincipal) Thread.CurrentPrincipal).Profile). Initialize((ExtendedPrincipal)Thread.CurrentPrincipal); // Accessing the Profile Information from the ProfileCollection: Response.Write("Profile Information from the Profile Collection thru the ExtendedPrincipal"); Response.Write("Profile Information: 'Preferred Investment Type' is "+(string)((ProfileCol