BV Commerce Forum
»
BV Commerce Support
»
General Support
»
Using the Webservice4 to get Authentication tokens
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. |
|
|
|
|
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 |
|
|
|
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. |
|
|
|
|
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. |
|
|
|
|
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.