Showing posts with label security. Show all posts
Showing posts with label security. Show all posts

Monday, March 26, 2012

newbie: PublicKeyToken

Hey

asp.net 2.0

Example PublicKeyToken:
type="System.Web.Security.SqlMembershipProvider, System.Web,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
How is a PublicKeyToken calculated?

perhaps some of you have a link to an article about the subject

Best Regards!

JeffThis is one of the better explanation you'll find on it:
http://www.c-sharpcorner.com/Code/2...enGenerator.asp
Karl
--
http://www.openmymind.net/
http://www.fuelindustries.com/
"Jeff" <it_consultant1@.hotmail.com.NOSPAMwrote in message
news:uXE1xTA2GHA.1132@.TK2MSFTNGP02.phx.gbl...

Quote:

Originally Posted by

Hey
>
asp.net 2.0
>
Example PublicKeyToken:
type="System.Web.Security.SqlMembershipProvider, System.Web,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
How is a PublicKeyToken calculated?
>
perhaps some of you have a link to an article about the subject
>
Best Regards!
>
Jeff
>
>

Saturday, March 24, 2012

newbie: security & themes!

Hey

asp.net 2.0

I have a webpage which get it's layout data from a theme. Using the theme
works without problem until I added these settings to the web.config file:
<authorization>
<deny users="?"/>
</authorization>

With this new settings in web.config the theme isn't applied to the page!

I've only tested this for unauthenticated users

Top-most script in Default.aspx file:
<%@dotnet.itags.org. Page Language="C#" MasterPageFile="~/MainMaster.master"
AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default"
Title="Untitled Page" Theme="Standard" %>

What should I do make the theme work with the newly applied web.config
settings?

JeffHi,
This is a strange problem, does your theme use Css or reference other images,
if so you need to allow access to these Css and image files for everyone,
for example i have two folder Css and Images where i store my css and other
images used in the site graphics i have to add these lines to the web.config
to allow access to these folders
<location path="images">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
<location path="Css">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>

May be this will resolve your problem.

Regards,
Mohamed Mosalem

"Jeff" wrote:

Quote:

Originally Posted by

Hey
>
asp.net 2.0
>
I have a webpage which get it's layout data from a theme. Using the theme
works without problem until I added these settings to the web.config file:
<authorization>
<deny users="?"/>
</authorization>
>
With this new settings in web.config the theme isn't applied to the page!
>
I've only tested this for unauthenticated users
>
Top-most script in Default.aspx file:
<%@. Page Language="C#" MasterPageFile="~/MainMaster.master"
AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default"
Title="Untitled Page" Theme="Standard" %>
>
What should I do make the theme work with the newly applied web.config
settings?
>
Jeff
>
>
>
>


Hello Mohamed, thank you for replying to this post!

Yes, this theme is using css, but the .css file is in the theme folder:
App_Themes\Standard\Default.css

This css file is referencing a image file which is placed in the same folder
as the Default.css file

Should I use this script then:
</location>
<location path="App_Themes\Standard\">
<system.web>

Any suggestions? maybe I instead should use a .skin file?

Jeff

"Mohamed Mosalem" <MohamedMosalem@.discussions.microsoft.comwrote in
message news:94DF0D8F-86D7-4704-8CC7-69150241CDD5@.microsoft.com...

Quote:

Originally Posted by

Hi,
This is a strange problem, does your theme use Css or reference other
images,
if so you need to allow access to these Css and image files for everyone,
for example i have two folder Css and Images where i store my css and
other
images used in the site graphics i have to add these lines to the
web.config
to allow access to these folders
<location path="images">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
<location path="Css">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
>
May be this will resolve your problem.
>
Regards,
Mohamed Mosalem
>
"Jeff" wrote:
>

Quote:

Originally Posted by

>Hey
>>
>asp.net 2.0
>>
>I have a webpage which get it's layout data from a theme. Using the theme
>works without problem until I added these settings to the web.config
>file:
><authorization>
><deny users="?"/>
></authorization>
>>
>With this new settings in web.config the theme isn't applied to the page!
>>
>I've only tested this for unauthenticated users
>>
>Top-most script in Default.aspx file:
><%@. Page Language="C#" MasterPageFile="~/MainMaster.master"
>AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default"
>Title="Untitled Page" Theme="Standard" %>
>>
>What should I do make the theme work with the newly applied web.config
>settings?
>>
>Jeff
>>
>>
>>
>>


Hi Jeff,
Of course you need the skin file, this file determines the styles and
properties that will be applied to the server controls
"Jeff" wrote:

Quote:

Originally Posted by

Hello Mohamed, thank you for replying to this post!
>
Yes, this theme is using css, but the .css file is in the theme folder:
App_Themes\Standard\Default.css
>
This css file is referencing a image file which is placed in the same folder
as the Default.css file
>
Should I use this script then:
</location>
<location path="App_Themes\Standard\">
<system.web>
>
Any suggestions? maybe I instead should use a .skin file?
>
Jeff
>
>
"Mohamed Mosalem" <MohamedMosalem@.discussions.microsoft.comwrote in
message news:94DF0D8F-86D7-4704-8CC7-69150241CDD5@.microsoft.com...

Quote:

Originally Posted by

Hi,
This is a strange problem, does your theme use Css or reference other
images,
if so you need to allow access to these Css and image files for everyone,
for example i have two folder Css and Images where i store my css and
other
images used in the site graphics i have to add these lines to the
web.config
to allow access to these folders
<location path="images">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
<location path="Css">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>

May be this will resolve your problem.

Regards,
Mohamed Mosalem

"Jeff" wrote:

Quote:

Originally Posted by

Hey
>
asp.net 2.0
>
I have a webpage which get it's layout data from a theme. Using the theme
works without problem until I added these settings to the web.config
file:
<authorization>
<deny users="?"/>
</authorization>
>
With this new settings in web.config the theme isn't applied to the page!
>
I've only tested this for unauthenticated users
>
Top-most script in Default.aspx file:
<%@. Page Language="C#" MasterPageFile="~/MainMaster.master"
AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default"
Title="Untitled Page" Theme="Standard" %>
>
What should I do make the theme work with the newly applied web.config
settings?
>
Jeff
>
>
>
>


>
>
>

Thursday, March 22, 2012

newboe: how to get the user name?

OS: XP pro
IDE VS 2005 .NET
ASP.NET 2.0
System.Security.AccessControl.SecurityInfos.Owner.ToString() returns
domain\username...if the domain is named "TEST" and username is "per" then
this statement returns TEST\per...
But what code must I do if I went to the fullname of the user?
JeffAsk the user to put it into a form. ;-)
Seriously, though, if the user is logged in to Active Directory, you should
be able to use the System.DirectoryServices namespace and classes to query
the Active Directory for this information.
HTH,
Kevin Spencer
Microsoft MVP
Professional Numbskull
Hard work is a medication for which
there is no placebo.
"Jeff" <it_consultant1@.hotmail.com.NOSPAM> wrote in message
news:un2nKgZeGHA.564@.TK2MSFTNGP02.phx.gbl...
> OS: XP pro
> IDE VS 2005 .NET
> ASP.NET 2.0
> System.Security.AccessControl.SecurityInfos.Owner.ToString() returns
> domain\username...if the domain is named "TEST" and username is "per" then
> this statement returns TEST\per...
> But what code must I do if I went to the fullname of the user?
> Jeff
>
Thanks, I'm looking into it now:
System.DirectoryServices.DirectoryEntry de = new
System.DirectoryServices.DirectoryEntry();
string fullname = de.Properties["displayName"].Value.ToString();
This code isn't working because I need to set the de.Path property before
executing the last line.. I'm not sure how to get the domain name the user
is logged into...Any tips would be great...
I've tryed, with out luck using this statment:
string domain = de.Properties["defaultNamingContext"][0];
This statement gives me an error message saying "This domain do not exist"
(or something like that, the error message I get on my computer is in
Norwegian and I translated it into English... I'm a native Norwegian)
What am I doing wrong here?
Any tips would be received with great appreciation!
Jeff
"Kevin Spencer" <kevin@.DIESPAMMERSDIEtakempis.com> wrote in message
news:uKn1CxZeGHA.5012@.TK2MSFTNGP05.phx.gbl...
> Ask the user to put it into a form. ;-)
> Seriously, though, if the user is logged in to Active Directory, you
> should be able to use the System.DirectoryServices namespace and classes
> to query the Active Directory for this information.
> --
> HTH,
> Kevin Spencer
> Microsoft MVP
> Professional Numbskull
> Hard work is a medication for which
> there is no placebo.
> "Jeff" <it_consultant1@.hotmail.com.NOSPAM> wrote in message
> news:un2nKgZeGHA.564@.TK2MSFTNGP02.phx.gbl...
>
Your app will only be able to get AD information about the domain it belongs
to.
HTH,
Kevin Spencer
Microsoft MVP
Professional Numbskull
Hard work is a medication for which
there is no placebo.
"Jeff" <it_consultant1@.hotmail.com.NOSPAM> wrote in message
news:%23hChlzaeGHA.3888@.TK2MSFTNGP02.phx.gbl...
> Thanks, I'm looking into it now:
> System.DirectoryServices.DirectoryEntry de = new
> System.DirectoryServices.DirectoryEntry();
> string fullname = de.Properties["displayName"].Value.ToString();
> This code isn't working because I need to set the de.Path property before
> executing the last line.. I'm not sure how to get the domain name the user
> is logged into...Any tips would be great...
> I've tryed, with out luck using this statment:
> string domain = de.Properties["defaultNamingContext"][0];
> This statement gives me an error message saying "This domain do not exist"
> (or something like that, the error message I get on my computer is in
> Norwegian and I translated it into English... I'm a native Norwegian)
> What am I doing wrong here?
> Any tips would be received with great appreciation!
> Jeff
>
> "Kevin Spencer" <kevin@.DIESPAMMERSDIEtakempis.com> wrote in message
> news:uKn1CxZeGHA.5012@.TK2MSFTNGP05.phx.gbl...
>

newboe: how to get the user name?

OS: XP pro
IDE VS 2005 .NET
ASP.NET 2.0

System.Security.AccessControl.SecurityInfos.Owner. ToString() returns
domain\username...if the domain is named "TEST" and username is "per" then
this statement returns TEST\per...

But what code must I do if I went to the fullname of the user?

JeffAsk the user to put it into a form. ;-)

Seriously, though, if the user is logged in to Active Directory, you should
be able to use the System.DirectoryServices namespace and classes to query
the Active Directory for this information.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Hard work is a medication for which
there is no placebo.

"Jeff" <it_consultant1@.hotmail.com.NOSPAM> wrote in message
news:un2nKgZeGHA.564@.TK2MSFTNGP02.phx.gbl...
> OS: XP pro
> IDE VS 2005 .NET
> ASP.NET 2.0
> System.Security.AccessControl.SecurityInfos.Owner. ToString() returns
> domain\username...if the domain is named "TEST" and username is "per" then
> this statement returns TEST\per...
> But what code must I do if I went to the fullname of the user?
> Jeff
Thanks, I'm looking into it now:

System.DirectoryServices.DirectoryEntry de = new
System.DirectoryServices.DirectoryEntry();
string fullname = de.Properties["displayName"].Value.ToString();

This code isn't working because I need to set the de.Path property before
executing the last line.. I'm not sure how to get the domain name the user
is logged into...Any tips would be great...

I've tryed, with out luck using this statment:
string domain = de.Properties["defaultNamingContext"][0];
This statement gives me an error message saying "This domain do not exist"
(or something like that, the error message I get on my computer is in
Norwegian and I translated it into English... I'm a native Norwegian)

What am I doing wrong here?

Any tips would be received with great appreciation!

Jeff

"Kevin Spencer" <kevin@.DIESPAMMERSDIEtakempis.com> wrote in message
news:uKn1CxZeGHA.5012@.TK2MSFTNGP05.phx.gbl...
> Ask the user to put it into a form. ;-)
> Seriously, though, if the user is logged in to Active Directory, you
> should be able to use the System.DirectoryServices namespace and classes
> to query the Active Directory for this information.
> --
> HTH,
> Kevin Spencer
> Microsoft MVP
> Professional Numbskull
> Hard work is a medication for which
> there is no placebo.
> "Jeff" <it_consultant1@.hotmail.com.NOSPAM> wrote in message
> news:un2nKgZeGHA.564@.TK2MSFTNGP02.phx.gbl...
>> OS: XP pro
>> IDE VS 2005 .NET
>> ASP.NET 2.0
>>
>> System.Security.AccessControl.SecurityInfos.Owner. ToString() returns
>> domain\username...if the domain is named "TEST" and username is "per"
>> then this statement returns TEST\per...
>>
>> But what code must I do if I went to the fullname of the user?
>>
>> Jeff
>>
Your app will only be able to get AD information about the domain it belongs
to.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Hard work is a medication for which
there is no placebo.

"Jeff" <it_consultant1@.hotmail.com.NOSPAM> wrote in message
news:%23hChlzaeGHA.3888@.TK2MSFTNGP02.phx.gbl...
> Thanks, I'm looking into it now:
> System.DirectoryServices.DirectoryEntry de = new
> System.DirectoryServices.DirectoryEntry();
> string fullname = de.Properties["displayName"].Value.ToString();
> This code isn't working because I need to set the de.Path property before
> executing the last line.. I'm not sure how to get the domain name the user
> is logged into...Any tips would be great...
> I've tryed, with out luck using this statment:
> string domain = de.Properties["defaultNamingContext"][0];
> This statement gives me an error message saying "This domain do not exist"
> (or something like that, the error message I get on my computer is in
> Norwegian and I translated it into English... I'm a native Norwegian)
> What am I doing wrong here?
> Any tips would be received with great appreciation!
> Jeff
>
> "Kevin Spencer" <kevin@.DIESPAMMERSDIEtakempis.com> wrote in message
> news:uKn1CxZeGHA.5012@.TK2MSFTNGP05.phx.gbl...
>> Ask the user to put it into a form. ;-)
>>
>> Seriously, though, if the user is logged in to Active Directory, you
>> should be able to use the System.DirectoryServices namespace and classes
>> to query the Active Directory for this information.
>>
>> --
>> HTH,
>>
>> Kevin Spencer
>> Microsoft MVP
>> Professional Numbskull
>>
>> Hard work is a medication for which
>> there is no placebo.
>>
>> "Jeff" <it_consultant1@.hotmail.com.NOSPAM> wrote in message
>> news:un2nKgZeGHA.564@.TK2MSFTNGP02.phx.gbl...
>>> OS: XP pro
>>> IDE VS 2005 .NET
>>> ASP.NET 2.0
>>>
>>> System.Security.AccessControl.SecurityInfos.Owner. ToString() returns
>>> domain\username...if the domain is named "TEST" and username is "per"
>>> then this statement returns TEST\per...
>>>
>>> But what code must I do if I went to the fullname of the user?
>>>
>>> Jeff
>>>
>>
>>