Posts Tagged ‘authentication’
Yeah, I know. It has been a LONG time since I posted anything. I’ve been busy.
One of my recent projects brought up something I think you may be interested in so I thought I’d post about it.
Recently, I created a Facebook tab for Labels For Education using DotNetNuke 6.1, which just added an API for retrieving information from Facebook.
In our series about ASP.NET authentication so far we’ve covered all the rather normal cases where you’d want to have the ability to log into different domains attached to the same application. There are a few additional hurdles you’ll need to overcome to make this work correctly.
The first is, how do I let each domain have its own unique set of logins?
Now that we’ve assigned roles to our users, we need to assign permissions to the roles.
The easiest way to do this is through the web.config file, which will allow us to control which pages the roles can access.
But how do we control items beyond pages? For that we’ll need to do a bit of “role your own” coding.
Another function that is not supplied by one of the existing controls in ASP.NET is the ability to assign a user to a role. For this, we will need to resort to using the APIs.
Since we can assign roles to users using the ASP.NET configuration tool, we can assume there is an API available that will do this work for us.
Here is how it is done.
There are several controls that allow you to display content based on the role a user is in, including:
And the web.config file allows us to control which pages can be viewed based on which role a user is in.
But what if you need to determine the role a user is in using the APIs? How do you do that?
It turns out that the API for this is really rather straightforward.