• Toll-free  888-665-8637
  • International  +1 717-220-0012
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

CorneliuTusnea
#1 Posted : Tuesday, January 23, 2007 8:44:25 PM(UTC)
CorneliuTusnea

Rank: Member

Joined: 8/17/2006(UTC)
Posts: 681

Hi guys,
I implemented my own WS for some custom operations and I would like to use the Webservices5.asmx to get Authentication tokens to use for call in my WS.

My workflow is like this:

1. Call WS4.Login with UserName/Password and get back an AuthenticationToken.

2. Call my WS.DoStuff( authenticationToken, myParameters).



The first line in my WS.DoStuff is (C# code .. sorry guys :)) :

if (AuthenticationToken.ValidateTokenForPermission(token, "07d8886d-c574-4121-958c-bb368c4b9f5c"))
{

...

}

where the "07d8886d-c574-4121-958c-bb368c4b9f5c" is the bvin of the 'Web Services Access' role.

I know user has that role. I'm very very sure of that, however I get back an exception "Could not authorize token" (or something simiar).



Is there a guide about how to use this? Can you provide some help on why I get an error or what is the correct way of using this call?



Thanks,

Corneliu.
http://www.bestgames.com.au
http://www.bestchess.com.au



BV Product Links, Details and Signatures: Improve your customer experience:

http://www.acorns.com.au/projects/bv/quicklink/

jetheredge
#2 Posted : Thursday, January 25, 2007 1:25:40 PM(UTC)
jetheredge

Rank: Member

Joined: 3/1/2006(UTC)
Posts: 1,142

The ValidateTokenForPermission is actually validating a permission, not a role. When you are logged in to the web services it checks to make sure you have web services access. The permissions are located in Membership.SystemPermissions.
Justin Etheredge
Senior Software Engineer
BVSoftware
CorneliuTusnea
#3 Posted : Friday, February 9, 2007 10:24:07 AM(UTC)
CorneliuTusnea

Rank: Member

Joined: 8/17/2006(UTC)
Posts: 681

More on this. I added two rows to the [bvc_RoleXRolePermission] to make a mapping betwen 'Product Admin' role and the 'Catalog View' and 'Catalog Edit' permissions.
So now this query:
select
bvc_User.bvin
, bvc_User.UserName
, bvc_RolePermission.Name
, bvc_RolePermission.bvin
from bvc_User
inner join bvc_UserXRole on bvc_User.bvin = bvc_UserXRole.UserID
inner join bvc_RoleXRolePermission on bvc_UserXRole.RoleID = bvc_RoleXRolePermission.RoleID
inner join bvc_RolePermission on bvc_RoleXRolePermission.PermissionID = bvc_RolePermission.bvin
where UserName = '<my user>'

returns
cff223b1-df11-4061-842b-70663deb8908 <my user> Catalog - Edit 0B2DCF72-145C-48e0-B5A3-7C54D44805D2
cff223b1-df11-4061-842b-70663deb8908 <my user> Catalog - View D0201557-356F-4ee6-A24C-3C0F85E2C472
which tells me the permissions/roles assignments for my user are all correct, however this code:
if (AuthenticationToken.ValidateTokenForPermission(token, BVSoftware.Bvc5.Core.Membership.SystemPermissions.CatalogView))
still returns false.

Any ideas?

Thanks,
Corneliu.
http://www.bestgames.com.au
http://www.bestchess.com.au



BV Product Links, Details and Signatures: Improve your customer experience:

http://www.acorns.com.au/projects/bv/quicklink/

CorneliuTusnea
#4 Posted : Friday, February 9, 2007 10:24:14 AM(UTC)
CorneliuTusnea

Rank: Member

Joined: 8/17/2006(UTC)
Posts: 681

Justin,
And how do permissions link to the groups that I can assign to a user from the UI?
When I create a user I have groups that he can be part of (Content Admin, Order Admin...)
I've added my user to all these groups but any permission I try to check for him returns false.
Is it because the bvc_RoleXRolePermission table is empty or I'm missing something else?
Thanks,
Corneliu.
http://www.bestgames.com.au
http://www.bestchess.com.au



BV Product Links, Details and Signatures: Improve your customer experience:

http://www.acorns.com.au/projects/bv/quicklink/

Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

©2024 Develisys. All rights reserved.
  • Toll-free  888-665-8637
  • International  +1 717-220-0012