oracle - Setting up an OracleRoleProvider in a C# ASP.NET MVC4 web application -


i'm having issues getting oracleroleprovider working in asp.net mvc4 web application using c#. i've read documentation perhaps missing , if lead me in right direction, i'd appreciate it.

it's windows authenticated/intranet application uses oracle sql server back-end data storage. have downloaded prerequisites , referenced them in solution in visual studio.

i have made following changes web.config file:

<!--configuration child--> <connectionstrings>     <add name="applicationstore" connectionstring="ezconnect oracle connection string"/> </connectionstrings>  <!--system.web child--> <rolemanager cacherolesincookie="true" enabled="true" defaultprovider="oracleroleprovider">   <providers>     <add name="oracleroleprovider"          type="oracle.web.security.oracleroleprovider,          oracle.web, version=4.122.1.0, culture=neutral,          publickeytoken=89b483f429c47342"          connectionstringname="applicationstore"          applicationname="appname"/>   </providers> </rolemanager> 

in global.asax.cs, under application_start() method, have done following:

string[] applicationroles = {     "administrators",     "general",     "enterprisereaders" };  foreach (string userrole in applicationroles) {     if (!roles.roleexists(userrole))     {         roles.createrole("userrole");     } } 

i'm going go ahead , doing wrong because following runtime error:

'ora_aspnet_roles_roleexists' must declared 

with information, created custom role provider see if when overwriting roleexists() , returning true got rid of error. did.

web.config changes:

<rolemanager cacherolesincookie="true" enabled="true" defaultprovider="customroleprovider">   <providers>     <add name="customroleprovider"          type="app.models.customroleprovider"          connectionstringname="applicationstore"          applicationname="appname"/>   </providers> </rolemanager> 

customroleprovider.cs:

using oracle.web.security; using system; using system.collections.generic; using system.linq; using system.web;  namespace app.models {     public class customroleprovider : oracleroleprovider     {         public override bool roleexists(string rolename)         {             return true;         }          public override void createrole(string rolename)         {          }     } } 
  • i under impression use oracleroleprovider out of box without writing custom class. wrong in assumption?
  • if have write customer provider, since connection string declared in web.config, there way access don't have redeclare connection string inside class?
  • if don't have write custom role provider, oracleroleprovider automagically create user-|--<-usertorole->--|-role schema me in database or take care of?


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -