app支付宝授权登录获取用户信息


 

  由后台进行地址的拼接(前台进行授权)

// 生成授权的参数
        String sign = "";
        Long userId1 = SecurityUser.getUserId();
        String pid = "";
        String appid = "";
        String privateKey = "";
        StringBuffer stringBuffer = new StringBuffer();
        stringBuffer.append("apiname=com.alipay.account.auth");
        stringBuffer.append("&app_id=");
        stringBuffer.append(appid);
        stringBuffer.append("&app_name=mc");
        stringBuffer.append("&auth_type=AUTHACCOUNT");
        stringBuffer.append("&biz_type=openservice");
        stringBuffer.append("&method=alipay.open.auth.sdk.code.get");
        stringBuffer.append("&pid=");
        stringBuffer.append(pid);
        stringBuffer.append("&product_id=APP_FAST_LOGIN");
        stringBuffer.append("&scope=kuaijie");
        stringBuffer.append("&sign_type=RSA2");
        stringBuffer.append("&target_id=");
        stringBuffer.append(userId1);
        sign = RSA.rsa2Sign(stringBuffer.toString(), "UTF-8", privateKey);
        stringBuffer.append("&sign="+ URLEncoder.encode(sign, "UTF-8"));
        return new Result().ok(stringBuffer.toString());

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM