Maybe the AccountId is really more related to the business logic of your
service than the infrastructure (which username/password supposedly belongs
to)?
If this is the case you may consider putting the accountId in your message
rather than in the headers, which are normally reserved for more
infrastructure related stuff (security, addressing, attachments, ...).
But if you choose to stick it in the header (and I dont thing the
UsernameToken has room for it), it must be because you want to have the
framework do the authorization before reaching your Web method, and in that
case there is no way around writing your own policy assertion.
Just a few thoughts, but if you need examples of writing your own assertions
they are becoming available in may places.
Niels
> I have a very simple set of credentials I need to authenticate and
> authorize against. I would assume this a common scenario for anyone
[quoted text clipped - 12 lines]
> appropriate or any better than just using the asmx headers and doing
> the auth in each method.
bradrover - 25 Jan 2006 18:13 GMT
Thanks Niels, yes I think accountID is really part of the business
logic. I'd prefer do the authorization in the request pipeline than in
each method if possible. I suppose I could go ahead with UserNameToken,
but then also add a custom policy assertion after that in the pipeline
to do the authorization, by picking the accountID out of the message
body.