所有示例均在gihub(ssh_base)中====>https://github.com/chengyangyang

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());

 

posted @ 2019-02-28 15:56  ☞书香门第☜  阅读(1238)  评论(0编辑  收藏  举报
http://count.knowsky.com/count1/count.asp?id=434520&sx=1&ys=64"