Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. Authorization and Profile Application Blocks

Authorization and Profile Application Blocks

Scheduled Pinned Locked Moved .NET (Core and Framework)
designsecuritycomgraphicscryptography
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nkiran
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups