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

  • Home
  • SEARCH
  • 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

Ask A Question

Stats

  • Questions 307k
  • Answers 307k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer ExecuteScalar only returns the first value from the first row… May 13, 2026 at 9:35 pm
  • Editorial Team
    Editorial Team added an answer I found this and it works : from M as… May 13, 2026 at 9:35 pm
  • Editorial Team
    Editorial Team added an answer lookup.SelectMany( x => x ).ToList() The transformation to ILookup and… May 13, 2026 at 9:35 pm

Related Questions

We're hitting a good number of walls and stumbling blocks as we create our
I'm using multiple role providers, the standard SQL provider plus a custom one. Inside
All our inhouse projects use Active Directory authentication and impersonation as this is the
I'm working on a project where I need the following. WCF service on the
I created a custom RoleProvider (standard webforms, no mvc) and I would like to

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.