Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 591807
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T15:40:24+00:00 2026-05-13T15:40:24+00:00

When I create a custom role provider by inheriting from RoleProvider, I created a

  • 0

When I create a custom role provider by inheriting from RoleProvider, I created a method
called public override string[] GetRolesForUser(string username) .. However, when I try
to use this Service Reference all I have access to is GetRolesForCurrentUser(). It works
and calls my method behind the scenes ok. As in, GetRoleseForCurrentUser passes the current
user into my method so it’s all good. But what I’m wondering is, is there a way for me to
also expose my original method (the one that takes an argument), or am I missing something?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T15:40:25+00:00Added an answer on May 13, 2026 at 3:40 pm

    Well, first off i have to assume some stuff, you are using Username/Password message layer authentication, and a custom role provider for the message layer authorization.

    If you are doing this make sure you secure the Transport layer

    The point of GetRolesForCurrentUser() is that it checks the current threads Principal user and returns all roles for that user, in that way the user can never impersonate somebody else. The Username/Password must be embedded into the Message headers, this happens automatically in .net when you set the proxy Credentials on the client.

    If the user calling the WCF client was allowed to pass his Username as a parameter, it means the role provider by design will still authenticate the user by the current threads Principal user and then you would want to authenticate further the user by the the Username passed to GetRolesForUser(string username), there is no point, besides some kind of complicated impersonation scheme.

    If that is you goal, check out this link

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If have created a custom role within SqlServer which I added to the db__denydatareader
I need to create a custom membership user and provider for an ASP.NET mvc
I have just finished creating a custom role provider using LINQ to SQL for
I'm using multiple role providers, the standard SQL provider plus a custom one. Inside
Our shop designs and create custom software applications for a vareity of vertical industies.
I think I know how to create custom encrypted RSA keys, but how can
Why do we need to create custom exceptions in .NET?
Are there any resources which show how to create custom GnuCash reports? I don't
Like the title says, how do you create custom code snippets in Visual Studio
I want to create a custom control in C#. But every time I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.