Unification not providing me user password and username

烂漫一生 提交于 2019-12-24 10:56:38

问题


When I am using Instagram sharing then how can I get username and password from Instagram (current login user).

$app = new UEApp(self::APP_SECRET, self::APP_SECRET);
$user = new UEUser($this->currentUser->unification_userkey, $this->currentUser->unification_usersecret);
$con = $access_token."@instagram.com/?username=rajneesh49&password=test&@instagram.com";

Now I am using static password and username then its working fine but How can I get current username and password(required filed by unification engine)

username and password both are required fields by unification engine.

How can I get this password and username in php code for unification engine sharing.

Authentication only provide this information

Array
(
    [access_token] => 4544942713.7da612b.4de7a5a78fba2b27a60dc1749d
    [user] => Array
        (
            [id] => 45434542713
            [username] => rajneesh8469
            [profile_picture] => https://scontent.cdninstagram.com/t51.2885-19/s150x150/16229522_1877141895853233_7596497588304478208_a
.jpg
            [full_name] => Rajneesh
            [bio] => Testing website
            [website] => http://localhost:3000/
  ))

But only password is missing so how can I get current user password.


回答1:


This problem not related with any code or unification its only related with Security validation. I have fixed same issue in same sharing but I have fixed this problem by authentication please do below some changes as per application

  1. Create Instagram authentication
  2. Get username (only username authentication not providing password)
  3. Open User validation popup in exiting application (then show username and and asking to user please enter password)
  4. Please do not save user password in you database (its related with security)
  5. Then use same parameters for sharing

Only change this according to password:

$con = $access_token."@instagram.com/?username=".$username.'&password='.$password&@instagram.com";

please do this as per security social networking proving good security as per application(Instagram is good as per security) .




回答2:


We could see that you can now specify optional parameters while you add a connection, with the updated version of SDK (https://github.com/unifiedinbox/ue-php-sdk).

The optional params for each connections are specified in documentation under 'Add connection' section https://developer.unificationengine.com/ In case of instagram, the optional params are "username" and "password".



来源:https://stackoverflow.com/questions/42502740/unification-not-providing-me-user-password-and-username

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!