0

I want to make wcf authentication, by username and password. After that, to make custom attributes to services, to restrict access by username. For example if authenticated username is User to restrict access to delete, if moderator to allow. How to do that, and what are the best practices?

1

1 Answer 1

1

What you need is:

You can also thing about using roles and assign users to roles outside of your service - it will simplify authorization once you will need multiple users to do the same thing.

Sign up to request clarification or add additional context in comments.

5 Comments

If i want to restrict access to some services, without changing the implementation of service? I mean to make a custom attribute, but is possible to create cookies and check by cookie if user is admin or simple user?
You need custom service authorization manager which can be assigned from the configuration file.
Can i know what is the username of authenticated user, that requires a service?
Try operationContext.ServiceSecurityContext.PrimaryIdentity.Name
Can i use NetSqlAzMan as an authorization manager, and membership provider?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.