Click here to Skip to main content
15,309,158 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralManaging User Accounts and Gruops at Runtime Pin
joaoPaulo17-Sep-04 2:09
MemberjoaoPaulo17-Sep-04 2:09 
GeneralRe: Managing User Accounts and Gruops at Runtime Pin
Anonymous17-Sep-04 12:14
MemberAnonymous17-Sep-04 12:14 
GeneralUsing Windows XP Visual Styles Pin
aninddroy16-Sep-04 23:24
Memberaninddroy16-Sep-04 23:24 
QuestionHow does .net runtime bind an assembly at runtime Pin
pgupta808016-Sep-04 21:30
Memberpgupta808016-Sep-04 21:30 
AnswerRe: How does .net runtime bind an assembly at runtime Pin
sukesh.g19-Sep-04 20:42
Membersukesh.g19-Sep-04 20:42 
General.NET Remoting hosted in IIS Pin
be kunkun16-Sep-04 20:01
Memberbe kunkun16-Sep-04 20:01 
GeneralIrregular shaped forms Pin
loewe19876516-Sep-04 19:20
Memberloewe19876516-Sep-04 19:20 
GeneralAuthorization and Profile Application Blocks Pin
nkiran15-Sep-04 18:57
Membernkiran15-Sep-04 18:57 
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)((ProfileCollection)
((ExtendedPrincipal)Thread.CurrentPrincipal).
Profile)["stockProfile"]["preferredInvestmentType"].Value );
Response.Write("Profile Information: 'Trades Frequently' is " +
Boolean.Parse(((string)((ProfileCollection)
((ExtendedPrincipal)Thread.
CurrentPrincipal).Profile)["stockProfile"]
["tradesFrequently"].Value)));
Response.Write("Profile Information: 'Most Traded Stocks' is " +
(string)((ProfileCollection)
((ExtendedPrincipal)Thread.CurrentPrincipal).
Profile)["stockProfile"]["stockTrades"]
["mostTradedStocks"].Value);


}

#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}

///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///

private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);

}
#endregion
}
}


With Many Thanks
kiran
GeneralStrangest bug I think I've seen Pin
darrellp15-Sep-04 5:52
Memberdarrellp15-Sep-04 5:52 
GeneralRe: Strangest bug I think I've seen Pin
Anonymous15-Sep-04 6:49
MemberAnonymous15-Sep-04 6:49 
GeneralApplication Protection Pin
Member 132035214-Sep-04 22:18
MemberMember 132035214-Sep-04 22:18 
GeneralActiveX problem Pin
archetype14-Sep-04 1:36
Memberarchetype14-Sep-04 1:36 
Generalcharts in visual c++ Pin
dana_krycek14-Sep-04 1:35
Memberdana_krycek14-Sep-04 1:35 
GeneralRe: charts in visual c++ Pin
ursus zeta15-Sep-04 13:51
Memberursus zeta15-Sep-04 13:51 
GeneralRe: charts in visual c++ Pin
dana_krycek16-Sep-04 8:24
Memberdana_krycek16-Sep-04 8:24 
GeneralSorry for not Replying Pin
ursus zeta22-Sep-04 11:51
Memberursus zeta22-Sep-04 11:51 
Generalhelp in list view control Pin
bora3ee13-Sep-04 9:51
Memberbora3ee13-Sep-04 9:51 
GeneralRe: help in list view control Pin
Tomas Petricek15-Sep-04 14:29
MemberTomas Petricek15-Sep-04 14:29 
Generalhelp in process class Pin
bora3ee13-Sep-04 9:49
Memberbora3ee13-Sep-04 9:49 
QuestionIs there a way to use a DataTable in COM ? Pin
DavPen13-Sep-04 8:27
MemberDavPen13-Sep-04 8:27 
GeneralImage filter for black and white images in GDI+ Pin
BLBANET13-Sep-04 4:07
MemberBLBANET13-Sep-04 4:07 
GeneralRe: Image filter for black and white images in GDI+ Pin
Anonymous15-Sep-04 7:25
MemberAnonymous15-Sep-04 7:25 
GeneralMultithreaded Design Question Pin
tulip1234512-Sep-04 0:01
Membertulip1234512-Sep-04 0:01 
QuestionHow to catch mouse click message? Pin
Volvere10-Sep-04 14:02
MemberVolvere10-Sep-04 14:02 
AnswerRe: How to catch mouse click message? Pin
Tomas Petricek11-Sep-04 14:34
MemberTomas Petricek11-Sep-04 14:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.