Skip to content

Commit

Permalink
fix url
Browse files Browse the repository at this point in the history
  • Loading branch information
jeasonzhu committed Dec 9, 2016
1 parent 4a4d933 commit 9ff3f35
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
14 changes: 7 additions & 7 deletions doc/App_Integration_Guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ open .

在弹出的Finder窗口中打开工程文件```wechatauthdemo.xcworkspace```。在工程树中找到并修改**Info.plist**中的App信息,如下图所示:

![](https://raw.githubusercontent.com/Tencent/WeDemo/master/doc/image/WXAppInfo.jpg)
![](https://raw.githubusercontent.com/weixin-open/WeChatAuthDemo/master/doc/image/WXAppInfo.jpg)

将图中的WXAppInfo中的AppId和AppDescription的值修改为你在[https://open.weixin.qq.com](https://open.weixin.qq.com)上注册的App信息,否则将无法在应用程序启动时向微信注册。

Expand All @@ -50,7 +50,7 @@ open .

在工程树设置文件中找到Bundle Indentifier的值修改为你在[https://open.weixin.qq.com](https://open.weixin.qq.com)上登记的Bundle Id,如下图所示:

![](https://raw.githubusercontent.com/Tencent/WeDemo/master/doc/image/BundleId.jpg)
![](https://raw.githubusercontent.com/weixin-open/WeChatAuthDemo/master/doc/image/BundleId.jpg)

##修改服务器信息

Expand All @@ -59,19 +59,19 @@ open .
###替换服务器地址
找到[BaseNetworkEngine.m](https://github.com/weixin-open/WeChatAuthDemo/blob/master/iOS/wechatauthdemo/Service/BaseNetworkEngine.m)文件,修改defaultHost的值为你自己的服务器地址,如下图所示:

![](https://raw.githubusercontent.com/Tencent/WeDemo/master/doc/image/defaultHost.jpg)
![](https://raw.githubusercontent.com/weixin-open/WeChatAuthDemo/master/doc/image/defaultHost.jpg)

###替换服务器RSA公钥和自签名SSL证书

将服务器中用于与App通信的RSA公钥和SSL证书下载下来, 然后打开[BaseNetworkEngine.m](https://github.com/weixin-open/WeChatAuthDemo/blob/master/iOS/wechatauthdemo/Service/BaseNetworkEngine.m)文件,将公钥内容复制替换掉,如下图所示:

![](https://raw.githubusercontent.com/Tencent/WeDemo/master/doc/image/RSAPublicKey.jpg)
![](https://raw.githubusercontent.com/weixin-open/WeChatAuthDemo/master/doc/image/RSAPublicKey.jpg)

**注意,我们这里强烈建议使用2048位以上的钥匙对,具体生成密钥指南详见[WeChatAuthDemo生成RSA钥匙对与自签名证书指南](https://github.com/Tencent/WeDemo/wiki/WeChatAuthDemo生成密钥与自签名证书指南)**

接下来将原来的工程的Bundle Resource中的SSL证书替换成你自己的自签名证书,如下图所示:

![](https://raw.githubusercontent.com/Tencent/WeDemo/master/doc/image/serverCer.jpg)
![](https://raw.githubusercontent.com/weixin-open/WeChatAuthDemo/master/doc/image/serverCer.jpg)

##编写新的功能
你可以在WeChatAuthDemo的基础上添加你自己的功能,完成你的App。
Expand Down Expand Up @@ -118,6 +118,6 @@ open .

WeChatAuthDemo在Debug模式下还在首页提供了一个可以修改CGI配置的调试页面,同时还在App全局提供摇一摇手势呼出日志窗口,你还可以在他们上面集成其它调试工具如[FLEX](https://github.com/Flipboard/FLEX)等, enjoy! **:-)**

![](https://raw.githubusercontent.com/Tencent/WeDemo/master/doc/image/Index.jpg)|![](https://raw.githubusercontent.com/Tencent/WeDemo/master/doc/image/Debug.jpg)
![](https://raw.githubusercontent.com/weixin-open/WeChatAuthDemo/master/doc/image/Index.jpg)|![](https://raw.githubusercontent.com/weixin-open/WeChatAuthDemo/master/doc/image/Debug.jpg)
-------|-------
![](https://raw.githubusercontent.com/Tencent/WeDemo/master/doc/image/Log.jpg)|
![](https://raw.githubusercontent.com/weixin-open/WeChatAuthDemo/master/doc/image/Log.jpg)|
12 changes: 6 additions & 6 deletions doc/Php_Integration_Guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ vim config.php

###3.2 修改AppID和AppSecret

![步骤图:修改AppId和AppSecret](https://raw.githubusercontent.com/Tencent/WeDemo/master/doc/image/config_step1.jpg)
![步骤图:修改AppId和AppSecret](https://raw.githubusercontent.com/weixin-open/WeChatAuthDemo/master/doc/image/config_step1.jpg)

请先参照上图,再按以下步骤操作:

Expand All @@ -66,13 +66,13 @@ vim config.php

###3.3 修改SDK路径

![步骤图:修改SDK路径](https://raw.githubusercontent.com/Tencent/WeDemo/master/doc/image/config_step2.jpg)
![步骤图:修改SDK路径](https://raw.githubusercontent.com/weixin-open/WeChatAuthDemo/master/doc/image/config_step2.jpg)

把demo clone下来后可直接使用默认的SDK路径,如需要改变SDK路径,可将第13行`define('WX_AUTH_SDK_PATH', __DIR__ . '/../sdk/');``'/../sdk/'`修改为新的SDK路径。

###3.4 修改Database路径

![步骤图:修改Database路径](https://raw.githubusercontent.com/Tencent/WeDemo/master/doc/image/config_step3.jpg)
![步骤图:修改Database路径](https://raw.githubusercontent.com/weixin-open/WeChatAuthDemo/master/doc/image/config_step3.jpg)

该demo使用文件存储的方式来作为Database,如果开发者想沿用这种方式,可按照以下步骤操作:

Expand All @@ -97,23 +97,23 @@ chmod 744 YourDatabaseDir

**注意,我们这里强烈建议使用2048位以上的钥匙对,具体生成密钥指南详见**[WeChatAuthDemo生成密钥与自签名证书指南](https://github.com/Tencent/WeDemo/wiki/WeChatAuthDemo生成密钥与自签名证书指南)

![步骤图:修改RSA密钥路径及文件名](https://raw.githubusercontent.com/Tencent/WeDemo/master/doc/image/config_step4.jpg)
![步骤图:修改RSA密钥路径及文件名](https://raw.githubusercontent.com/weixin-open/WeChatAuthDemo/master/doc/image/config_step4.jpg)

* 生成了私钥文件`rsa_private.key`和公钥文件`rsa_public.key`后将文件移动到开发者自定义的密钥目录(这里暂时使用`YourRSADir`来代替),目录的生成过程可参照[3.4 修改Database路径](#user-content-34-修改database路径)的终端代码;
* 开发者可以重命名私钥文件`rsa_private.key`,这里暂时使用`YourRSAPrivate.key`来代替;
* 修改第20行`define('WX_AUTH_RSA_PRIVATE_KEY', __DIR__ . '/_key/rsa_private.key');``'/_key/rsa_private.key'`修改为`'/YourRSADir/YourRSAPrivate.key'`

###3.6 修改加密登陆票据(token、密码等)的盐(salt)

![步骤图:修改加密登陆票据(token、密码等)的盐(salt)](https://raw.githubusercontent.com/Tencent/WeDemo/master/doc/image/config_step5.jpg)
![步骤图:修改加密登陆票据(token、密码等)的盐(salt)](https://raw.githubusercontent.com/weixin-open/WeChatAuthDemo/master/doc/image/config_step5.jpg)

**为避免暴力破解,建议开发者不要使用默认值!**

可通过修改第24行`define('WX_AUTH_SALT', 'WxAuthDemo');``'WxAuthDemo'`修改为开发者自定义的盐。

###3.7 修改票据相关时间和第三方业务相关错误码(可选)

![步骤图:修改票据相关时间和第三方业务相关错误码(可选)](https://raw.githubusercontent.com/Tencent/WeDemo/master/doc/image/config_step6.jpg)
![步骤图:修改票据相关时间和第三方业务相关错误码(可选)](https://raw.githubusercontent.com/weixin-open/WeChatAuthDemo/master/doc/image/config_step6.jpg)

**该步骤为可选步骤,请开发者根据自己的实际情况进行修改。**

Expand Down
14 changes: 7 additions & 7 deletions doc/Sequence.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ AppServer->AppClient: 4. ConnectResponse: psk作为密钥的\nAES加密(temp_uin
note left of AppClient: 5. AppClient用psk作为密钥的\nAES解密保存temp_uin
-->

![](https://raw.githubusercontent.com/Tencent/WeDemo/master/doc/image/connect.png)
![](https://raw.githubusercontent.com/weixin-open/WeChatAuthDemo/master/doc/image/connect.png)

<b>以下为详细说明:</b>

Expand Down Expand Up @@ -67,7 +67,7 @@ AppServer->AppClient: 7. WXLoginResponse: AES加密(loginTicket, Uin)
note left of AppClient: 8. 用psk解密Uin,\nLoginTicket并保存。
-->

![](https://raw.githubusercontent.com/Tencent/WeDemo/master/doc/image/wxLogin.png)
![](https://raw.githubusercontent.com/weixin-open/WeChatAuthDemo/master/doc/image/wxLogin.png)

<b>以下为详细说明: </b>

Expand Down Expand Up @@ -104,7 +104,7 @@ AppServer->AppClient: 4. CheckLoginResponse: temp_key\n作为密钥的AES加密(
note left of AppClient: 5. 用temp_key解密SK,\nexpireTime并保存。
-->

![](https://raw.githubusercontent.com/Tencent/WeDemo/master/doc/image/checkLogin.png)
![](https://raw.githubusercontent.com/weixin-open/WeChatAuthDemo/master/doc/image/checkLogin.png)

<b>以下为详细说明:</b>

Expand Down Expand Up @@ -140,7 +140,7 @@ AppServer->AppClient: 5. GetUserInfoResponse: SK\n作为密钥的AES加密(App
note left of AppClient: 6. 解密用户信息\n并保存显示。
-->

![](https://raw.githubusercontent.com/Tencent/WeDemo/master/doc/image/getUserInfo.png)
![](https://raw.githubusercontent.com/weixin-open/WeChatAuthDemo/master/doc/image/getUserInfo.png)

<b>以下为详细说明:</b>

Expand Down Expand Up @@ -182,7 +182,7 @@ note left of AppClient: 8. 更新SK和有效期\n重发请求
AppClient->AppServer: 9. GetUserInfoRequest或\nwxBindAppRequest或\nappBindWXRequest
-->

![](https://raw.githubusercontent.com/Tencent/WeDemo/master/doc/image/SKExpired.png)
![](https://raw.githubusercontent.com/weixin-open/WeChatAuthDemo/master/doc/image/SKExpired.png)

<b>以下为详细说明:</b>

Expand Down Expand Up @@ -215,7 +215,7 @@ WXOpenServer->AppServer: 3. {New AccessToken ExpireTime}
note left of AppServer: 4. 再次请求微信信息
-->
![](https://raw.githubusercontent.com/Tencent/WeDemo/master/doc/image/accessTokenExpired.png)
![](https://raw.githubusercontent.com/weixin-open/WeChatAuthDemo/master/doc/image/accessTokenExpired.png)

<b>以下为详细说明:</b>

Expand Down Expand Up @@ -244,7 +244,7 @@ note over AppClient, AppServer: 4. 重新进行利用微信SSO\n换取登录票
note left of AppClient: 5. 重新登录AppServer\n并获取用户信息
-->

![](https://raw.githubusercontent.com/Tencent/WeDemo/master/doc/image/refreshTokenExpired.png)
![](https://raw.githubusercontent.com/weixin-open/WeChatAuthDemo/master/doc/image/refreshTokenExpired.png)

<b>以下为详细说明:</b>

Expand Down

0 comments on commit 9ff3f35

Please sign in to comment.