Error using membership in WCF

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
y0zh
Posts: 1
Joined: Fri 14 May 2010 08:03
Location: Russia, Krasnodar

Error using membership in WCF

Post by y0zh » Fri 14 May 2010 08:47

Hello everybody. Sorry for my English.
I have a trouble using PgSqlMembershipProvider in WCF services for authentication.
My configuration section in web.config for service

Code: Select all



			
				
				
			
		
		
			
				
				
			
		
...

Code: Select all

		

    
		
			
				
					
					
          
            
          
          
				
			
		
		
			
				
          
            
          
				
			
		
		
			
        
          
            
          
        
				
				
			
		
	

When i call my method

Code: Select all

[OperationContract]
[PrincipalPermission(SecurityAction.Demand, Role = "admin")]
public string[] AdminMethod()                                      



  RefusedSet=""
  Url=""
  StackTrace:
       in System.Security.Permissions.PrincipalPermission.ThrowSecurityException()
       in System.Security.Permissions.PrincipalPermission.Demand()
       in System.Security.PermissionSet.DemandNonCAS()
       in GISService.Authenticate(String UserName, String PasswordHash) в c:\Users\User\Documents\Visual Studio 2010\Projects\MyProject\site\App_Code\MyService.cs:string 590
       in SyncInvokeAuthenticate(Object , Object[] , Object[] )
       in System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
  InnerException: 
[/quote]
  
  Why it occurs?

StanislavK
Devart Team
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Post by StanislavK » Thu 20 May 2010 16:18

For Visual Studio 2010, the problem may be caused by the fact that the default hash algorithm was changed from SHA1 to HMACSHA256 in .NET Framework v4. We will set the hash algorithm explicitly in our code, the fix will be available in one of the nearest builds.

As a temporary workaround, please set the hash algorithm to SHA1 in ASP.NET providers of your application. For more information on this issue, please see the following topic:
http://www.devart.com/forums/viewtopic.php?t=17508

If the problem persists, please send us a small test project with which the problem can be reproduced.

Post Reply