on ‎2018 Sep 27 11:03 PM
Hello,
I am using the below url to get the cart information for anonymous user using guid that is generated in the browser.
If I try to access the above url in another machine able to get the cart information.
Some one can hack the url and can get the cart information in the above case. How do I make sure the above url will work only for that user not for any one else?
Also same thing for cart url also..
https://localhost:9002/rest/v2/electronics/users/abcd@abcd.com/carts/00004000
The above url need the email address of user and cart id to get the cart information. How do I protect the username and cart id so that no one else can access the cart information using the above url.
The above url required token which will be generated using the below url https://localhost:9002/authorizationserver/oauth/token
Again to get the token using the above url you need to pass client id and secret id (which is basically username and pwd).
How to protect the OCC urls to work only for that user not for any one else if some one hacked and trying the url.
Any help would be appreciated.
Request clarification before answering.
Thanks for your quick response Avinash. Please see the attachment..
(1) I created a token using postman and used that token with the below url from 2 pc's
https://localhost:9002/rest/v2/electronics/users/abcd@abcd.com/carts/00004000
I am able to get the cart information from both pc's. Which means some one can hack the token id , username and cart id that is passed part of the url right?
(2) The below url used to get the cart info using guid for anonymous user.. This url tried from 2 diff pc's and able to get the cart information
Am I missing some thing here? I was expecting it should return any data if I try from anohter pc because the OCC call should not be valid
Thanks in advance
[1]: /storage/temp/11494-token-generation.png
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you have a valid token, you can access the resource, regardless of where the request is coming from. That's how OAuth2 is supposed to work! The token is the secret that needs to be guarded, not the URL.
The anonymous user is a special case, here you can access the cs long as you know the GUID, because otherwise you would have to login before you can add anything to a cart. And since the anonymous user is, well, anonymous, you don't have any secret information you need to guard.
HI, To get oAuth, you will send the details in POST method which is secure, so nothing to worry about loosing your identity. And to get cart information via OCC V2, you need authorization in header, which can be trusted_client or Customer or Customer_manager. This will be assigned based on what attributes you used in fetching oAuth token and OCC is session less protocol, once it serves the response it will kill the session.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.