henryjwr

See also: Other Geeks@INDC
If you Install Visual Studio 2005 SP1 On Vista...
Don't forget to install this

VS2005 SP1 Update for Vista

 

CoolDevil 

 

 

Share this post: | | | |
When the Dream come true?

 Think for considering a OSS....


The big question is while the world is on crisis, is there any company can afford to "Buying" Solution?

So, is there any chance 4 Us in MIC environment to participated on OSS way?. And how we do it?

So maybe the solution from MIC use Prefix DreamXXXX like DreamSpark....your dream come true or still just a dream.. .?

Hopefully MIC in the future also considering Open License feature in their business Solution, While us for Soft Dev will have a lot more opportunity to serve.

Some MIC License: (https://partner.microsoft.com/40032369)

Full Packaged Product
Full packaged product (FPP) refers to the shrink-wrapped box of licensed software sold through the distribution channel to resellers. The consumer usually acquires the product from a reseller. Each FPP generally contains one license per box, along with media and documentation, and is designed to meet low-volume needs.

OEM System Builder
An original equipment manufacturer (OEM) system builder is usually a computer manufacturer who sells their hardware with preinstalled software. An OEM license is often the easiest and most economical way for customers to receive their Windows operating system software.

Downloaded Software for Consumers
Customers can obtain some types of software by downloading them from the Microsoft Download Center. The downloaded software is subject to the usage restrictions of the online Retail Software License Terms, which is displayed when the software is being downloaded.

Microsoft Volume Licensing
Microsoft Volume Licensing programs serve the needs of organizations that acquire multiple licenses, but don’t need multiple copies of the media and the documentation, and don’t want to keep track of numerous individual Retail Software License Terms. Volume Licensing offers the potential for substantial savings, ease of deployment, flexible acquisition, varied payment options, and other benefits such as ongoing maintenance.

Microsoft Solution Provider Agreement
The Microsoft Solution Provider Agreement (SPA) grants resellers the right to place orders with a Microsoft Regional Operations Center for certain Microsoft business-management solutions software licenses and related services. This is the only way resellers can distribute Microsoft Dynamics licenses.

Share this post: | | | |
A Story of C# Keyword

Every time I try and catch an abstract I see some virtual object using an interface to throw him self to return to Hell. This nightmare event continue hunting me foreach day of my life. There is no private and protected room for me to hide any more. This unsafe life i can't switch and neither void it. Maybe i can sealed it out. The long road a head become const and static for me. Wish i could delegate my feel to you.
finally I want to override my life, and fixed everything on its way. Starting a new life, a new case story, a new class society. this dream maybe it's yours dream too.

Share this post: | | | |
Try and Catch Security Application Block

Try and Catch Security Application Block

Just Like my previous post, i wrote this in MS.Word and the picture is not show when i pasted it to this pane..[:'(], I have attach file

 

The Security Application Block was created to simplify and standardized the way that applications authorized and cache security information within an application.

Look and Feel Security Application Block Design

If we look closely Security Application Block was design with flexibility to implement different security issue in an application and also provide most standard security implementation. Security Application Block profiles the user information that could be used in form of context.

Figure  SEQ Figure \* ARABIC 25 Authorization Object Model

 

Figure  SEQ Figure \* ARABIC 26 SecurityCache Object Model

Let’s examine the each of the class that involve in the object model.

The AuthorizationFactory is the class that you could get the authorization provider. There are two implementations of the provider AzManAuthorizationProvider and AuthorizationRuleProvider. AzMan (Authorization Manager) provider provide standard interface to maintain Active Directory, roles groups, tasks and operations. The AzManAuthorizationProvider provide functionality that easy determine the authorization from the user identity information. On the other hand AuthorizationRuleProvider determine authorization with defined rule for each task or operation.

Figure  SEQ Figure \* ARABIC 27 AuthorizationFactory

Figure  SEQ Figure \* ARABIC 28 AzManAuthorizationProvider

Figure  SEQ Figure \* ARABIC 29 AuthorizationRuleProvider

Authorization need to use information to authenticated user with their profile. This information basically store in stateless storage. The user should be verified whenever one or more requests have been made to the server or application. These processes could hit the performance.  Security Application Block will help this problem with solution via cache. The Security Application Block cache the user profile so it could be use throughout application.

Figure  SEQ Figure \* ARABIC 30 SecurityCacheFactory

Like AuthorizationFactory Security Application Block provide Factory design pattern to get Cache Store Provider via SecurityCacheFactory.

Figure  SEQ Figure \* ARABIC 31 CachingStoreProvider

The CachingStoreProvider responsibilities to return user profile information. It could return user identity and principal that has been defined in their profile.

Unlock Security Application Block

I will show you how to implementing Rule Provider using AuthorizationRuleProvider.

1.       First create application configuration.

2.       Edit the application with Enterprise Library Configuration Editor.

3.       Add Security Application Block to the configuration

Action :: App Config Root >> New >> Security Application Block

You could only create one Security Application Block per application level.

4.       Creating Authorization Rule Provider, by right click the Authorization node.

Action :: Authorization >> New >> Authorization Rule Provider

This will create Rule Provider Node. You could rename the rule provider. Let’s say you rename it to “MyTestRuleProvider”.  You could have more than one Authorization Rule Provider in the application.

5.       Next Add Rule to the Rule Provider that has been created before.

Action :: Rule Provider >> New >> Rule

Rename the rule to “MyTestRule”.

6.       Each Rule has expression that defines the rule algorithm. Define the rule expression by click the ellipsis button in the expression property.  This action will show us Rule Expression Editor.

Figure  SEQ Figure \* ARABIC 32 Rule Expression Editor

In the Rule Expression Editor there are many buttons that you could use to create expression for the rule. The rule expression logic defines Identity and Principle that will be authenticated. Let’s assume we define that only Identity of henry, ela and role Manager that should be allowed other will denied. We could test the expression with given value.

7.       Close the Enterprise Library Configuration Editor. You will see that Enterprise Library Configuration Editor will update the application configuration.

<?xml version="1.0" encoding="utf-8"?>

<configuration>

  <configSections>

    <section

      name="securityConfiguration"

      type="Microsoft.Practices.EnterpriseLibrary.Security.Configuration.

SecuritySettings,

            Microsoft.Practices.EnterpriseLibrary.Security,

            Version=3.1.0.0,

            Culture=neutral,

            PublicKeyToken=b03f5f7f11d50a3a" />

    <section

      name="dataConfiguration"

      type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.

DatabaseSettings,

            Microsoft.Practices.EnterpriseLibrary.Data,

            Version=3.1.0.0,

            Culture=neutral,

            PublicKeyToken=b03f5f7f11d50a3a" />

  </configSections>

  <securityConfiguration

    defaultAuthorizationInstance=""

    defaultSecurityCacheInstance="">

    <authorizationProviders>

      <add

        type="Microsoft.Practices.EnterpriseLibrary.Security.

AuthorizationRuleProvider,

              Microsoft.Practices.EnterpriseLibrary.Security,

              Version=3.1.0.0,

              Culture=neutral,

              PublicKeyToken=b03f5f7f11d50a3a"

        name="MyTestRuleProvider">

        <rules>

          <add

            expression="(I:henry OR I:ela) AND R:Manager "

            name="MyTestRule" />

        </rules>

      </add>

    </authorizationProviders>

  </securityConfiguration>

</configuration>

Figure  SEQ Figure \* ARABIC 33 Enterprise Library Configuration Editor

8.       After finishing the configuration let create code that consume the configuration class.

You will need to add two references in this code.

o   System.Security.dll

This will provide Identity and Principal object.

o   Microsoft.Practices.EnterpriseLibrary.Security.dll

This will provide Authorization Provider.

                This the code snippet

using System;

using System.Collections.Generic;

using System.Text;

 

using System.Security.Principal;

using Microsoft.Practices.EnterpriseLibrary.Security;

 

namespace UsingSecurityApplicationBlock

{

    class Program

    {

        static void Main(string[] args)

        {

            TestAuthorization();

        }

 

        public static void TestAuthorization()

        {

            IPrincipal principle = new GenericPrincipal(

                new GenericIdentity("henry"), new string[] { "Manager" });

 

            IAuthorizationProvider provider =

                AuthorizationFactory.GetAuthorizationProvider(

"MyTestRuleProvider");

            bool authorized = provider.Authorize(principle, "MyTestRule");

 

            if (authorized)

                Console.WriteLine("You are authorized to use this...");

            else

                Console.WriteLine("You are not authorized to use this...");

           

            Console.WriteLine("Press any key to exit!");

            Console.ReadLine();

        }

    }

}

First we create principle object that pass IIdentity and array of string role. Create instance of IAuthorizationProvider pass the rule provider name. Call Authorize method to invoke authentication process. This method returns bool value whether the authentication failed or succeeded.

We have seen how to implement Authorization using Security Application Block, let’s move to use cache with Security Application Block.

Using Cache Store provider we could retrieve and save information regarding user profile.

1.       If you follow the step of creating Rule Provider, you could edit the file by Enterprise Library Editor too.

2.       Create Caching Store Provider

Action :: Security Cache Node >> New >> Caching Store Provider

This action will create Caching Store Provider node.

These node have properties like this:

Property Name

Description

Name

Caching Store Provider name

AbsoluteExpiration

Number of minutes in which the added object expires and is remove from the cache

CacheManager

Name

Description

ExpirationPollFrequencyInSeconds

Interval of checking expirations

MaximumElementsInCacheBeforeScavenging

Maximum number of cache items stored before scavenging occurs

Name

Cache Manager name

NumberToRemoveWhenScavenging

Number of cache items to remove when scavenging occurs

SlidingOperation

The number of minutes between the time added object was last accessed and when object expires

Figure  SEQ Figure \* ARABIC 34 Caching Store Provider Properties Definition

3.       Define the property like this screen shoot

Figure  SEQ Figure \* ARABIC 35 Caching Store Provider Properties

4.       You will see your application configuration file has been updated like this

<?xml version="1.0" encoding="utf-8"?>

<configuration>

  <configSections>

    <section

      name="securityConfiguration"

     

type="Microsoft.Practices.EnterpriseLibrary.Security.

Configuration.SecuritySettings,

            Microsoft.Practices.EnterpriseLibrary.Security,

            Version=3.1.0.0, C

            ulture=neutral,

            PublicKeyToken=b03f5f7f11d50a3a" />

    <section

      name="dataConfiguration"

     

type="Microsoft.Practices.EnterpriseLibrary.Data.

Configuration.DatabaseSettings,

            Microsoft.Practices.EnterpriseLibrary.Data,

            Version=3.1.0.0,

            Culture=neutral,

            PublicKeyToken=b03f5f7f11d50a3a" />

    <section

      name="cachingConfiguration"

     

type="Microsoft.Practices.EnterpriseLibrary.

Caching.Configuration.CacheManagerSettings,

            Microsoft.Practices.EnterpriseLibrary.Caching,

            Version=3.1.0.0,

            Culture=neutral,

            PublicKeyToken=b03f5f7f11d50a3a" />

  </configSections>

  <securityConfiguration

    defaultAuthorizationInstance="" defaultSecurityCacheInstance="">

    <authorizationProviders>

      <add

       

type="Microsoft.Practices.EnterpriseLibrary.

Security.AuthorizationRuleProvider,

                  Microsoft.Practices.EnterpriseLibrary.Security,

                  Version=3.1.0.0,

                  Culture=neutral,

                  PublicKeyToken=b03f5f7f11d50a3a"

            name="MyTestRuleProvider">

        <rules>

          <add

            expression="(I:henry OR I:ela) AND R:Manager "

            name="MyTestRule" />

        </rules>

      </add>

    </authorizationProviders>

    <securityCacheProviders>

      <add

        cacheManagerInstanceName="MyCacheManager"

        defaultSlidingSessionExpirationInMinutes="10"

        defaultAbsoluteSessionExpirationInMinutes="60"

        type="Microsoft.Practices.EnterpriseLibrary.

Security.Cache.CachingStore.CachingStoreProvider,

  Microsoft.Practices.EnterpriseLibrary.

Security.Cache.CachingStore,

              Version=3.1.0.0,

              Culture=neutral,

              PublicKeyToken=b03f5f7f11d50a3a"

        name="MyCachingStoreProvider" />

    </securityCacheProviders>

  </securityConfiguration>

  <cachingConfiguration

    defaultCacheManager="MyCacheManager">

    <cacheManagers>

      <add

        expirationPollFrequencyInSeconds="60"

        maximumElementsInCacheBeforeScavenging="1000"

        numberToRemoveWhenScavenging="10"

        backingStoreName="Null Storage"

        name<