开发者

Can I change a test user's password

开发者 https://www.devze.com 2023-04-09 04:43 出处:网络
Is it possible to change a test user\'s password so I can logon to any of my test users as normal so I can test my app properly?

Is it possible to change a test user's password so I can logon to any of my test users as normal so I can test my app properly?

I've tried :

https://graph.facebook.com/{user id}?password={newpassword}&method=post&access_token={the access token}

I got the access token from the 开发者_如何转开发Roles screen where all my test users are listed. The above link returns :

{
   "error": {
      "message": "Invalid OAuth access token.",
      "type": "OAuthException"
   }
}

What am I doing wrong? And is there another way to change the password?

I have 15 or so test users and I need to be able to log in as any of them. Only my main test user is registered with my app, the others are friends of the main test user (this is by design)

I tried creating lots of normal users to test with and quickly realised Facebook do their best to stop people doing this

Thanks


Yes - You can. However I have tried only manually - it works.

  1. You have to be admin of application for which users You are editing
  2. Go to FB Developers page -> Click 'Edit Roles'
  3. At the bottom of the page there will be all users listed, each having option to set password next to its profile photo. Just Click and change.

Hope that helps a bit. As it is not a solution to set manually password for 25 users. But if it is not possible to do it manually then it won't be possible with API. worth to try, just to identify error.

Yes - creating real users for testing purposes is not an option


This is very Easy by using even APP Dashboard as follow

Can I change a test user's password


All though you can use Graph API for the same ,with User APP Access Toke or User access Token (If user ID is accessed) for this Process
Here is Python script of the same


For some reason, Facebook's documentation says that you should do an HTTP POST, but the example they show uses a query string, not post data.

Try submitting all query parameters as post data:

curl -H "Content-Type: application/x-www-form-urlencoded" \
--data "access_token=<facebook app access token>&method=post&name=<full user name>&password=<password>" \
-X POST 'https://graph.facebook.com/<facebook test user id>'
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号