Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / August 2004

Tip: Looking for answers? Try searching our database.

Roles from Policy

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ilvy - 18 Aug 2004 09:07 GMT
Is there some way that I can retrieve the roles of my webservice in my custom
UsernameTokenManager from policy?
I defined all the roles in policy and I can retrieve all the roles that the
person is in who is calling the webservice. Now I'd like to know which roles
you have to be in to access the webservice :)
Because I defined them in policy, I want to prevent having to copy paste
them in my code, and prefer to access policy programmaticly in some way
unknown to me :)

Thx!
HongMei Ge - 19 Aug 2004 06:14 GMT
Hi!

You can try to retrieve this role information from the
LoadSecurityTokenAssertion method in your customized UsernameTokenManager.

public class MyUsernameTokenManager: UsernameTokenManager {
 public override ISecurityTokenAssertion
LoadSecurityTokenAssertion(XmlElement element)

 {

   /*  parse the element to get the role element

       this element should look like

       <SecurityToken xmlns="http://schemas.xmlsoap.org/ws/2002/12/secext">

<wssp:TokenType>http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-user
name-token-profile-1.0#UsernameToken</wssp:TokenType>
           <wssp:Claims>
               <wssp:UsePassword wsp:Usage="wsp:Rejected" />

               <wse:Role>Administrator</wse:Role>
           </wssp:Claims>
         </SecurityToken>

   */

   // Do not foget to invoke the base class

   return base.LoadSecurityTokenManager(element);

 }

}

Hope this helps.

hongmei

> Is there some way that I can retrieve the roles of my webservice in my custom
> UsernameTokenManager from policy?
[quoted text clipped - 6 lines]
>
> Thx!
Ilvy - 19 Aug 2004 13:27 GMT
Hi!

Thanks a lot!! I wasn't sure on how to use that method, or what it was for
;D even though I looked up all the SecurityTokenManager methods. But this was
exactly the information that I needed! Thanks!!!

Ilvy

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.