WO2017067227A1 - 一种第三方账号授权方法、设备、服务器及其系统 - Google Patents

一种第三方账号授权方法、设备、服务器及其系统 Download PDF

Info

Publication number
WO2017067227A1
WO2017067227A1 PCT/CN2016/088564 CN2016088564W WO2017067227A1 WO 2017067227 A1 WO2017067227 A1 WO 2017067227A1 CN 2016088564 W CN2016088564 W CN 2016088564W WO 2017067227 A1 WO2017067227 A1 WO 2017067227A1
Authority
WO
WIPO (PCT)
Prior art keywords
user
authorization
party
user account
account
Prior art date
Application number
PCT/CN2016/088564
Other languages
English (en)
French (fr)
Inventor
牛云飞
Original Assignee
乐视控股(北京)有限公司
乐视致新电子科技(天津)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 乐视控股(北京)有限公司, 乐视致新电子科技(天津)有限公司 filed Critical 乐视控股(北京)有限公司
Publication of WO2017067227A1 publication Critical patent/WO2017067227A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/40Network security protocols
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/0815Network architectures or network communication protocols for network security for authentication of entities providing single-sign-on or federations
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/0807Network architectures or network communication protocols for network security for authentication of entities using tickets, e.g. Kerberos

Definitions

  • Embodiments of the present invention relate to the technical field related to account management, and in particular, to a third party account authorization method, device, server, and system thereof.
  • a smart phone refers to a stand-alone operating system and a separate operating space like a personal computer.
  • the user can install programs such as software, games, navigation, and other third-party service providers, and can implement wireless networks through a mobile communication network.
  • the software running on the smartphone is called an app, and the app can bring a lot of functions to the smartphone.
  • the user account is used to identify the user's identity, so how to ensure the security of the user's account is very important.
  • the prior art generally uses the user account to be saved to the server, and the user authenticates by the user password when logging in.
  • the embodiment of the invention provides a method for authorizing a third party account, including:
  • the user information is recalled to the third party application.
  • the acquiring an authorization code for the pre-bound user account includes:
  • the method further includes:
  • the user account and the user password are received by the server through the login page.
  • the method further includes: acquiring the access token and the user Account association save;
  • the authorization request for responding to the third-party application specifically includes:
  • the access token saved in association with the user account is saved, the access token and the user account are directly sent to the server, and the access is obtained from the server. After the token is verified, the user information about the user account is passed, otherwise if a pre-bound user account is provided, then the The authorization code for the pre-bound user account.
  • the user information is returned to the third-party application, and specifically includes:
  • the user information is hash encapsulated and then returned to the third party application.
  • the request for the authorization of the third-party application specifically includes: displaying an authorization page, responding to an authorization request of the third-party application triggered by the authorization page, where the authorization page is generated by using the Java-based Android system, and the The display resource of the authorization page is from at least one resource file saved in the form of a Java library, and the resource file identifier of each of the resource files is obtained from the R file provided by the Android system by using a reflection mechanism of Java.
  • Embodiments of the present invention provide a computer program comprising computer code adapted to perform all the steps of a third party account authorization method as described above when run on a computer.
  • the computer program is embodied on a computer readable medium.
  • the embodiment of the invention provides a method for authorizing a third party account, including:
  • the access token being responsive to an authorization request of the third-party application by the device, and acquiring the pre-bound user account when the pre-bound user account is provided And after the authorization code is sent to the user center, obtaining an access token about the authorization code from the user center;
  • the application identifier and the application key sent by the device when the device determines that the user account is not bound to the device, and the application identifier and the application key are applications of the third-party application acquired by the device. Identification and application key;
  • an authorization code for the user account is returned to the device.
  • Embodiments of the present invention provide a computer program comprising computer code adapted to perform all the steps of a third party account authorization method as described above when run on a computer.
  • the computer program is embodied on a computer readable medium.
  • the embodiment of the invention provides a third-party account authorization device, including:
  • a third-party authorization response module configured to: respond to an authorization request of a third-party application
  • An authorization code obtaining module configured to: obtain an authorization code for the pre-bound user account if a pre-bound user account is provided;
  • An access token obtaining module configured to: send the authorization code to a user center, and obtain an access token about the authorization code from the user center;
  • a user information obtaining module configured to: send the access token and a user account to a server, and obtain, from the server, user information about the user account after the access token is verified to pass;
  • the information callback module is configured to: call back the user information to the third party application.
  • the obtaining an authorization code for the pre-bound user account is specifically used to:
  • the authorization code obtaining module is further configured to: if there is no pre-bound user account, then:
  • the access token obtaining module acquires the access token and saves it in association with the user account
  • the third-party authorization response module is specifically configured to:
  • the user information acquisition module is directly executed, otherwise execution The authorization code acquisition module.
  • the information callback module is specifically configured to:
  • the user information is hash encapsulated and then returned to the third party application.
  • the third-party authorization response module is specifically configured to: display an authorization page, and respond to an authorization request of a third-party application triggered by the authorization page, where the authorization page is generated by using the Java-based Android system, and the authorization is
  • the display resource of the page is from at least one resource file saved in the form of a Java library, and the resource file identifier of each of the resource files is obtained from the R file provided by the Android system by using a reflection mechanism of Java.
  • An embodiment of the present invention provides a third-party account authorization server, including:
  • the access token receiving module is configured to: receive an access token and a user account from the device, where the access token is requested by the device to respond to an authorization request of the third-party application, and obtains when the pre-bound user account is provided After the authorization code of the pre-bound user account is sent to the user center, the access token for obtaining the authorization code is obtained from the user center;
  • a user information sending module configured to: verify the access token, and if the access token is verified, send user information about the user account to the device, where the user information is used by the device Used to call back to the third party application.
  • the method further includes: an authorization code sending module;
  • the authorization code sending module is configured to:
  • the application identifier and the application key sent by the device when the device determines that the user account is not bound to the device, and the application identifier and the application key are applications of the third-party application acquired by the device. Identification and application key;
  • an authorization code for the user account is returned to the device.
  • An embodiment of the present invention provides a third-party account authorization system, including: a device end as described above and a server end as described above.
  • the embodiment of the present invention provides a solution for authorizing a pre-bound account to a third-party application, so that the third-party application can obtain the authorization of the security account.
  • the third-party application can use the security account to perform various sensitive operations, such as payment and payment.
  • FIG. 1 is a flowchart of a third-party account authorization method applied to a device according to an embodiment of the present invention
  • FIG. 2 is a flowchart of a third-party account authorization method applied to a server according to an embodiment of the present invention
  • FIG. 3 is a structural block diagram of a third-party account authorization device according to an embodiment of the present invention.
  • FIG. 4 is a schematic structural diagram of a device according to another embodiment of the present invention.
  • FIG. 5 is a structural block diagram of a third-party account authorization server according to an embodiment of the present invention.
  • FIG. 6 is a schematic structural diagram of a server according to another embodiment of the present invention.
  • FIG. 7 is a structural block diagram of a third-party account authorization system according to an embodiment of the present invention.
  • FIG. 8 is a flowchart of a working process of a device for pre-binding a user account according to another embodiment of the present invention.
  • FIG. 1 is a flowchart of a third-party account authorization method according to an embodiment of the present invention, including:
  • Step S101 comprising: responding to an authorization request of a third-party application
  • Step S102 comprising: if a pre-bound user account is provided, acquiring an authorization code for the pre-bound user account;
  • Step S103 comprising: sending the authorization code to a user center, and acquiring an access token about the authorization code from the user center;
  • Step S104 Send the access token and the user account to the server, and obtain, from the server, the user account after the access token is verified and passed.
  • User Info
  • Step S105 comprising: calling back the user information to the third party application.
  • the method of the embodiment of the present invention may be provided to a software developer in the form of a Software Development Kit (sdk).
  • the software application developed by the software developer that is, the third-party application, requests authorization by calling a function provided by sdk, and triggers step S101 to respond to the authorization request.
  • the authorization code of the pre-bound user account is obtained, and the authorization code is sent to the user center for implementing integrated management of the user information, and the user center may be integrated with the device or may be integrated with the server. It can also be a separate device.
  • the access token is obtained in step S103, and is sent to the server through the access token. Since the sent token is sent, it can hide the authorization code well and prevent the authorization code from being illegally acquired.
  • step S104 after verifying the access token, the server returns relevant user information, and the user information is called back to the third-party application by using a callback function provided by the third-party application.
  • the security is high, so that the third-party application can implement various sensitive operations, such as payment and payment, by using the user account.
  • the obtaining an authorization code for the pre-bound user account includes:
  • the application identifier and the application key of the third-party application are further verified to ensure that the third-party application has the corresponding authority to obtain the authorization code of the pre-bound user account, thereby further improving security.
  • the step S102 further includes: if there is no pre-bound user account, then:
  • This embodiment adds support for a user account that is not pre-bound, that is, if the user uses a device that is pre-bound with a user account, it can obtain the authorization code directly in the device. However, if the user does not use pre-binding A device with a user account can log in to the server to obtain an authorization code, and the server verifies the application identifier and application key of the third-party application to ensure that it has sufficient rights.
  • step S103 the access token is acquired and saved in association with the user account
  • the step S101 specifically includes:
  • step S104 When the authorization request is saved in association with the user account, the step S104 is directly executed, otherwise the step S102 is performed.
  • the existing access token can be directly used, thereby reducing the step process, improving the acquisition speed of the user information, and enabling the user to obtain a better user experience.
  • the step S105 specifically includes:
  • the user information is hash encapsulated and then returned to the third party application.
  • the callback is performed by hash encapsulation, thereby improving the callback speed.
  • the user information is encapsulated by using a hash map, that is, a HashMap method.
  • the step S101 includes: displaying an authorization page, in response to an authorization request of a third-party application triggered by the authorization page, the authorization page is generated by using the Java-based Android system, and the authorization is The display resource of the page is from at least one resource file saved in the form of a Java library, and the resource file identifier of each of the resource files is obtained from the R file provided by the Android system by using a reflection mechanism of Java.
  • the resource file in this embodiment is provided in the form of a library, and the resource file identifier of all the resource files in the original R file is identified.
  • the source file id is retrieved using a reflection mechanism, so that the sdk can be successfully called by the Java developer.
  • FIG. 2 is a flowchart of a third-party account authorization method according to an embodiment of the present invention, including:
  • Step S201 comprising: receiving an access token and a user account from the device, where the access token is requested by the device to respond to an authorization request of the third-party application, and the pre-bind is obtained when the pre-bound user account is provided.
  • the authorization code of the user account is sent, and the authorization code is sent to the user center, an access token about the authorization code is obtained from the user center;
  • Step S202 comprising: verifying the access token, and if the access token is verified, sending user information about the user account to the device, where the user information is used by the device for callback To the third party application.
  • This embodiment is applied to a server, and the server returns the user information of the user account after verifying the access token.
  • the method further includes: an authorization code sending step;
  • the authorization code sending step includes:
  • the application identifier and the application key sent by the device when the device determines that the user account is not bound to the device, and the application identifier and the application key are applications of the third-party application acquired by the device. Identification and application key;
  • an authorization code for the user account is returned to the device.
  • the step of this embodiment processes the login request when the user adopts the device that does not bind the user account in advance, and returns the corresponding authorization code.
  • FIG. 8 is a flowchart of a device for pre-binding a user account according to a preferred embodiment of the present invention.
  • the device is a mobile phone, and specifically includes:
  • the application identifier (appid), application key (appsecret), openid, and secret_key that are authorized by the server are first required.
  • Step S801 the appid, appsecret is transmitted to the agent agent placed in the mobile phone rom, If the appid and appsecret are successfully verified, directly open the login interface and authorize the login. Upon successful login, the authorization code (code) returned by the agent will be obtained. Specifically:
  • Step S802 Sending to the user center through http, the user center returns an access token (accesstoken) of the user corresponding to the authorization code according to the authorization code, specifically:
  • the developer's incoming appid, appsecrect, authorization code, and callback address are combined to form a json string.
  • the HttpClient POST sends a getAccessTokenFromServer request to the user center, and then uses the RequestCallback interface callback to retrieve the returned Json field from the user center. , parsing it with JSONObject, taking the accesstoken, uid field;
  • Step S803 obtaining the account information of the user by using an accesstoken, specifically:
  • the accesstoken and uid are passed to the getUserBasicInfo method.
  • the getUserBasicInfo method the appid, uid, accesstoken, and uid are combined into a json string.
  • the getUserBasicInfoFromServer request is sent according to the HttpClient Get to obtain the basic information of the user.
  • the returned information includes: uid , nickname, accesstoken, file_300*300, file_200*200, file_70*70, file_50*50.
  • step S804 after obtaining the user information, the accesstoken, the uid, the nickname, and the like are stored in the local storage through the shareprefer of the android, and the uid is used as the primary key. If the login is directly clicked according to the history, the user information in all the shareprefers is obtained. Displaying, then taking the user's accesstoken according to the user information, and then performing step S803, taking the user information, and calling back the information.
  • Step S805 the information is returned to the third-party application for processing the account information through the callback interface provided by the sdk, and the callback interface encapsulates the user information into a HashMap, and then the developer can directly operate the HashMap object directly, specifically:
  • HashMap ⁇ String,Object>userInfo new HashMap ⁇ String,Object>()
  • HashMap object is then directly called back to the developer.
  • the landing page is generated as follows:
  • appsecret and callback address spell out a url to log in
  • the format is as follows:
  • the sdk of the preferred embodiment of the present invention directly accesses the R file due to the resource file in the jar. There is a conflict in the query, so access to all resource files is obtained using the java reflection mechanism. Specifically, a Mresource class is provided to obtain the resource file id according to the class name (className) of the resource class and the resource file name (name).
  • Mresource a getIdByName(Context context, String className, String name) is provided. This method will get the corresponding id according to the className and the id name.
  • the corresponding R file is first reflected according to the package name, and then the class is traversed in the R file. If the resource class is found, the id corresponding to the name value used in the resource class is directly returned.
  • FIG. 3 is a structural block diagram of a third-party account authorization device according to an embodiment of the present invention, including:
  • the third-party authorization response module 301 is configured to: respond to an authorization request of the third-party application;
  • the authorization code obtaining module 302 is configured to: obtain an authorization code for the pre-bound user account if a pre-bound user account is provided;
  • the access token obtaining module 303 is configured to: send the authorization code to a user center, and obtain an access token about the authorization code from the user center;
  • the user information obtaining module 304 is configured to: send the access token and the user account to the server, and obtain, from the server, user information about the user account after the access token is verified to pass;
  • the information callback module 305 is configured to: call back the user information to the third party use.
  • the obtaining an authorization code for the pre-bound user account is specifically used to:
  • the authorization code obtaining module 302 is further configured to: if there is no pre-bound user account, then:
  • the access token obtaining module 303 obtains the access token and saves it in association with the user account;
  • the third-party authorization response module 301 is specifically configured to:
  • the user information acquisition module 304 is directly executed, and the authorization code acquisition module 302 is otherwise executed.
  • the information callback module 305 is specifically configured to:
  • the user information is hash encapsulated and then returned to the third party application.
  • the third-party authorization response module 301 is specifically configured to: display an authorization page, and respond to an authorization request of a third-party application triggered by the authorization page, where the authorization page is generated by using a Java-based Android system. And the display resource of the authorization page is from at least one resource file saved in the form of a Java library, and the resource file identifier of each of the resource files is obtained from the R file provided by the Android system by using a reflection mechanism of Java.
  • FIG. 4 is a structural block diagram of a device according to an embodiment of the present invention, which mainly includes: The processor 401, the memory 402, the communication component 403, the display screen 404, and the like.
  • the device of the present invention is preferably a smartphone, a tablet, a smart TV, or the like.
  • the specific code of the foregoing method is stored in the memory 402, and is executed by the processor 401.
  • the authorization interface is displayed through the display screen 404, and the access token and the user account are sent to the server through the communication component 403, and the user information is received and passed through the processor 401. Callback to a third-party app.
  • FIG. 5 is a structural block diagram of a third-party account authorization server according to an embodiment of the present invention, including:
  • the access token receiving module 501 is configured to: receive an access token and a user account from the device, where the access token is obtained by the device in response to an authorization request of the third-party application, and is obtained when a pre-bound user account is provided. After the authorization code of the pre-bound user account is sent to the user center, an access token for the authorization code is obtained from the user center;
  • the user information sending module 502 is configured to: verify the access token, and if the access token is verified, send user information about the user account to the device, where the user information is The device is used to call back to the third party application.
  • the method further includes: an authorization code sending module;
  • the authorization code sending module is configured to:
  • the application identifier and the application key sent by the device when the device determines that the user account is not bound to the device, and the application identifier and the application key are applications of the third-party application acquired by the device. Identification and application key;
  • an authorization code for the user account is returned to the device.
  • FIG. 6 is a structural block diagram of a server according to an embodiment of the present invention.
  • the server may be a computer or a cluster of multiple computers, and mainly includes a processor 601, a memory 602, and a communication component 603.
  • the specific code of the foregoing method is stored in the memory 602, and is executed by the processor 601, and the access token and the user account sent by the device are received by the communication component 603, and After the processor 601 queries the user information from the memory 602, the user information is returned to the device through the communication component 603.
  • FIG. 7 is a structural block diagram of a third-party account authorization system according to an embodiment of the present invention, including: a device end 71 and a server end 72;
  • the device end 71 includes:
  • the device-side third-party authorization response module 711 is configured to: respond to an authorization request of the third-party application;
  • the device-side authorization code obtaining module 712 is configured to: obtain an authorization code for the pre-bound user account if a pre-bound user account is provided;
  • the device-side access token obtaining module 713 is configured to: send the authorization code to a user center, and obtain an access token about the authorization code from the user center;
  • the device-side user information obtaining module 714 is configured to: send the access token and the user account to the server, and obtain user information about the user account from the server;
  • the device-side information callback module 715 is configured to: call back the user information to the third-party application;
  • the server end 72 includes:
  • the server-side access token receiving module 721 is configured to: receive an access token and a user account from the device;
  • the server-side user information sending module 722 is configured to: verify the access token, and if the access token is verified, send user information about the user account to the device.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Telephonic Communication Services (AREA)

Abstract

本发明实施例公开一种第三方账号授权方法、设备、服务器及其系统,方法包括:响应第三方应用的授权请求;如果设有预先绑定的用户账号,则获取关于所述预先绑定的用户账号的授权码;将所述授权码发送至用户中心,从所述用户中心获取关于所述授权码的访问令牌;将所述访问令牌和用户账号发送到服务器,从所述服务器获取在所述访问令牌验证通过后的关于所述用户账号的用户信息;将所述用户信息回调至所述第三方应用。本发明实施例通过提供一种能够将预先绑定的账号授权给第三方应用使用的方案,使得第三方应用能够获取该安全账号的授权,从而使得第三方应用能够采用该安全账号进行各种敏感操作,例如支付付费等。

Description

一种第三方账号授权方法、设备、服务器及其系统
本申请要求在2015年10月22日提交中国专利局、申请号为201510694688.2、发明名称为“一种第三方账号授权方法、设备、服务器及其系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明实施例涉及账号管理相关技术领域,特别是一种第三方账号授权方法、设备、服务器及其系统。
背景技术
智能手机,是指像个人电脑一样,具有独立的操作系统,独立的运行空间,可以由用户自行安装软件、游戏、导航等第三方服务商提供的程序,并可以通过移动通讯网络来实现无线网络接入的手机类型。
智能手机中所运行的软件称为应用(App),通过App能够为智能手机带来非常多的功能。
用户账号是用于标识用户身份,因此如何保证用户账号的安全非常重要。现有技术一般采用的是将用户账号保存到服务器,用户在登陆时通过用户密码进行验证。
然而,当用户账号过多时,其很难保证其账号的安全性,因此App很难采用账号进行敏感操作,例如支付付费等。
发明内容
基于此,有必要针对现有技术难以保证账号的安全性的技术问题,提供一种第三方账号授权方法、设备、服务器及其系统。
本发明实施例提供一种第三方账号授权方法,包括:
响应第三方应用的授权请求;
如果设有预先绑定的用户账号,则获取关于所述预先绑定的用户 账号的授权码;
将所述授权码发送至用户中心,从所述用户中心获取关于所述授权码的访问令牌;
将所述访问令牌和用户账号发送到服务器,从所述服务器获取在所述访问令牌验证通过后的关于所述用户账号的用户信息;
将所述用户信息回调至所述第三方应用。
进一步的,所述获取关于所述预先绑定的用户账号的授权码,具体包括:
获取所述第三方应用的应用标识和应用密钥;
对所述应用标识和所述应用密钥进行验证,如果验证通过,获取关于所述预先绑定的用户账号的授权码。
进一步的,在所述如果设有预先绑定的用户账号,则获取关于所述预先绑定的用户账号的授权码之后,所述方法还包括:
如果没有预先绑定的用户账号,则:
获取所述第三方应用的应用标识和应用密钥;
将所述应用标识和所述应用密钥发送到服务器;
显示所述服务器对所述应用标识和所述应用密钥进行验证后所返回的登陆页面;
获取所述服务器对用户账号和用户密码验证通过后所返回的关于所述用户账号的授权码,将所述授权码发送至用户中心,从所述用户中心获取关于所述授权码的访问令牌,所述用户账号和所述用户密码由所述服务器通过所述登陆页面接收得到。
进一步的,在所述将所述授权码发送至用户中心,从所述用户中心获取关于所述授权码的访问令牌之后,所述方法还包括:获取所述访问令牌后与所述用户账号关联保存;
所述响应第三方应用的授权请求,具体包括:
当响应于第三方应用的授权请求时,如果保存有与所述用户账号关联保存的访问令牌,则直接将所述访问令牌和用户账号发送到服务器,从所述服务器获取在所述访问令牌验证通过后的关于所述用户账号的用户信息,否则如果设有预先绑定的用户账号,则获取关于所述 预先绑定的用户账号的授权码。
进一步的,所述将所述用户信息回调至所述第三方应用,具体包括:
将所述用户信息进行哈希封装后回调至所述第三方应用。
进一步的,所述响应第三方应用的授权请求,具体包括:显示授权页面,响应由所述授权页面所触发的第三方应用的授权请求,所述授权页面采用Java基于安卓系统生成,且所述授权页面的显示资源来自以Java库形式保存的至少一个资源文件,且每个所述资源文件的资源文件标识采用Java的反射机制从安卓系统所提供的R文件中获取。
本发明实施例提供一种计算机程序,包括在计算机上运行时,适合执行如前所述的第三方账号授权方法的所有步骤的计算机代码。
进一步的,所述计算机程序收录在计算机可读媒介上。
本发明实施例提供一种第三方账号授权方法,包括:
接收到来自设备的访问令牌和用户账号,所述访问令牌由所述设备响应第三方应用的授权请求,在设有预先绑定的用户账号时获取关于所述预先绑定的用户账号的授权码,并将所述授权码发送至用户中心后,从所述用户中心获取得到关于所述授权码的访问令牌;
对所述访问令牌进行验证,如果所述访问令牌验证通过,则将关于所述用户账号的用户信息发送至所述设备,所述用户信息由所述设备用于回调至所述第三方应用。
进一步的,还包括:
接收到设备判断没有与所述设备绑定的用户账号时,所发送的应用标识和应用密钥,所述应用标识和所述应用密钥为所述设备所获取的所述第三方应用的应用标识和应用密钥;
如果所述应用标识和所述应用密钥验证通过则向所述设备返回登陆页面,并通过所述登陆页面获取用户账号和用户密码;
如果对所述用户账号和所述用户密码验证通过,则向所述设备返回关于所述用户账号的授权码。
本发明实施例提供一种计算机程序,包括在计算机上运行时,适合执行如前所述的第三方账号授权方法的所有步骤的计算机代码。
进一步的,所述计算机程序收录在计算机可读媒介上。
本发明实施例提供一种第三方账号授权设备,包括:
第三方授权响应模块,用于:响应第三方应用的授权请求;
授权码获取模块,用于:如果设有预先绑定的用户账号,则获取关于所述预先绑定的用户账号的授权码;
访问令牌获取模块,用于:将所述授权码发送至用户中心,从所述用户中心获取关于所述授权码的访问令牌;
用户信息获取模块,用于:将所述访问令牌和用户账号发送到服务器,从所述服务器获取在所述访问令牌验证通过后的关于所述用户账号的用户信息;
信息回调模块,用于:将所述用户信息回调至所述第三方应用。
进一步的,所述获取关于所述预先绑定的用户账号的授权码,具体用于:
获取所述第三方应用的应用标识和应用密钥;
对所述应用标识和所述应用密钥进行验证,如果验证通过,获取关于所述预先绑定的用户账号的授权码。
进一步的,所述授权码获取模块,还用于:如果没有预先绑定的用户账号,则:
获取所述第三方应用的应用标识和应用密钥;
将所述应用标识和所述应用密钥发送到服务器;
显示所述服务器对所述应用标识和所述应用密钥进行验证后所返回的登陆页面;
获取所述服务器对用户账号和用户密码验证通过后所返回的关于所述用户账号的授权码,执行访问令牌获取模块,所述用户账号和所述用户密码由所述服务器通过所述登陆页面接收得到。
进一步的,所述访问令牌获取模块中,获取所述访问令牌后与所述用户账号关联保存;
所述第三方授权响应模块,具体用于:
当响应于第三方应用的授权请求时,如果保存有与所述用户账号关联保存的访问令牌,则直接执行所述用户信息获取模块,否则执行 所述授权码获取模块。
进一步的,所述信息回调模块,具体用于:
将所述用户信息进行哈希封装后回调至所述第三方应用。
进一步的,所述第三方授权响应模块,具体用于:显示授权页面,响应由所述授权页面所触发的第三方应用的授权请求,所述授权页面采用Java基于安卓系统生成,且所述授权页面的显示资源来自以Java库形式保存的至少一个资源文件,且每个所述资源文件的资源文件标识采用Java的反射机制从安卓系统所提供的R文件中获取。
本发明实施例提供一种第三方账号授权服务器,包括:
访问令牌接收模块,用于:接收到来自设备的访问令牌和用户账号,所述访问令牌由所述设备响应第三方应用的授权请求,在设有预先绑定的用户账号时获取关于所述预先绑定的用户账号的授权码,并将所述授权码发送至用户中心后,从所述用户中心获取得到关于所述授权码的访问令牌;
用户信息发送模块,用于:对所述访问令牌进行验证,如果所述访问令牌验证通过,则将关于所述用户账号的用户信息发送至所述设备,所述用户信息由所述设备用于回调至所述第三方应用。
进一步的,还包括,授权码发送模块;
所述授权码发送模块,用于:
接收到设备判断没有与所述设备绑定的用户账号时,所发送的应用标识和应用密钥,所述应用标识和所述应用密钥为所述设备所获取的所述第三方应用的应用标识和应用密钥;
如果所述应用标识和所述应用密钥验证通过则向所述设备返回登陆页面,并通过所述登陆页面获取用户账号和用户密码;
如果对所述用户账号和所述用户密码验证通过,则向所述设备返回关于所述用户账号的授权码。
本发明实施例提供一种第三方账号授权系统,包括:如前所述的设备端和如前所述的服务器端。
本发明实施例通过提供一种能够将预先绑定的账号授权给第三方应用使用的方案,使得第三方应用能够获取该安全账号的授权,从 而使得第三方应用能够采用该安全账号进行各种敏感操作,例如支付付费等。
附图说明
图1为本发明一实施例提供的应用于设备的一种第三方账号授权方法的工作流程图;
图2为本发明一实施例提供的应用于服务器的一种第三方账号授权方法的工作流程图;
图3为本发明一实施例提供的一种第三方账号授权设备的结构模块图;
图4为本发明另一实施例提供的设备结构示意图;
图5为本发明一实施例提供的一种第三方账号授权服务器的结构模块图;
图6为本发明另一实施例提供的服务器结构示意图;
图7为本发明一实施例提供的一种第三方账号授权系统的结构模块图;
图8为本发明另一实施例提供的针对预先绑定用户账号的设备的工作流程图。
具体实施方式
下面结合附图和具体实施例对本发明做进一步详细的说明。
如图1所示为本发明实施例的一种第三方账号授权方法的工作流程图,包括:
步骤S101,包括:响应第三方应用的授权请求;
步骤S102,包括:如果设有预先绑定的用户账号,则获取关于所述预先绑定的用户账号的授权码;
步骤S103,包括:将所述授权码发送至用户中心,从所述用户中心获取关于所述授权码的访问令牌;
步骤S104,包括:将所述访问令牌和用户账号发送到服务器,从所述服务器获取在所述访问令牌验证通过后的关于所述用户账号的 用户信息;
步骤S105,包括:将所述用户信息回调至所述第三方应用。
本发明实施例的方法可以采用软件开发工具包(Software Development Kit,sdk)的形式提供给软件开发者。软件开发者所开发的软件应用,即第三方应用,通过调用sdk所提供的函数请求授权,触发步骤S101,从而响应授权请求。步骤S102中,获取预先绑定的用户账号的授权码,并将该授权码发送到用于实现对用户信息的综合管理的用户中心,该用户中心可以与设备一体,也可以是与服务器一体,还可以是单独设备。步骤S103中获取到访问令牌,并通过访问令牌发送到服务器,由于所发送的是访问令牌,因此其能很好地隐藏授权码,避免授权码被非法获取。在步骤S104中,服务器对访问令牌验证后即返回相关的用户信息,该用户信息通过第三方应用所提供的回调函数回调至第三方应用。
本发明实施例由于采用的用户账号是预先绑定的,因此其安全性较高,从而使得第三方应用能够采用该用户账号实现各种敏感操作,例如支付付费等。
在其中一个实施例中,所述获取关于所述预先绑定的用户账号的授权码,具体包括:
获取所述第三方应用的应用标识和应用密钥;
对所述应用标识和所述应用密钥进行验证,如果验证通过,获取关于所述预先绑定的用户账号的授权码。
本实施例进一步对第三方应用的应用标识和应用密钥进行验证,以保证该第三方应用具有相应的权限以取得预先绑定的用户账号的授权码,从而进一步提高安全。
在其中一个实施例中,所述步骤S102,还包括:如果没有预先绑定的用户账号,则:
获取所述第三方应用的应用标识和应用密钥;
将所述应用标识和所述应用密钥发送到服务器;
显示所述服务器对所述应用标识和所述应用密钥进行验证后所返回的登陆页面;
获取所述服务器对用户账号和用户密码验证通过后所返回的关于所述用户账号的授权码,执行步骤S103,所述用户账号和所述用户密码由所述服务器通过所述登陆页面接收得到。
本实施例增加对没有预先绑定用户账号的支持,即如果用户采用的是一个预先绑定有用户账号的设备,则其可以直接在设备中获取授权码,然而,如果用户没有采用预先绑定有用户账号的设备,则其可以通过设备登陆服务器进而获取授权码,服务器对第三方应用的应用标识和应用密钥进行验证以确保其具有足够权限。
在其中一个实施例中,所述步骤S103中,获取所述访问令牌后与所述用户账号关联保存;
所述步骤S101,具体包括:
当响应于第三方应用的授权请求时,如果保存有与所述用户账号关联保存的访问令牌,则直接执行所述步骤S104,否则执行所述步骤S102。
本实施例中,针对已经取得过用户信息的用户账号,可以直接采用已有的访问令牌,从而减少步骤流程,提高用户信息的获取速度,使得用户获得更好的用户体验。
在其中一个实施例中,所述步骤S105,具体包括:
将所述用户信息进行哈希封装后回调至所述第三方应用。
本实施例通过哈希封装进行回调,从而提高回调速度。优选地,采用哈希地图,即HashMap方式对用户信息进行封装。
在其中一个实施例中,所述步骤S101,具体包括:显示授权页面,响应由所述授权页面所触发的第三方应用的授权请求,所述授权页面采用Java基于安卓系统生成,且所述授权页面的显示资源来自以Java库形式保存的至少一个资源文件,且每个所述资源文件的资源文件标识采用Java的反射机制从安卓系统所提供的R文件中获取。
安卓系统,即Android系统,当采用java进行开发时,其中有一个R文件,即R.Java文件,用于保存资源文件,然而,由于同一个jar包中不能同时具有两个R文件,因此,本实施例的资源文件以library的形式提供,且将原R文件中,所有资源文件的资源文件标识,即资 源文件id采用反射机制来取得,从而使得该sdk能够顺利的被Java开发者调用。
如图2所示为本发明实施例的一种第三方账号授权方法的工作流程图,包括:
步骤S201,包括:接收到来自设备的访问令牌和用户账号,所述访问令牌由所述设备响应第三方应用的授权请求,在设有预先绑定的用户账号时获取关于所述预先绑定的用户账号的授权码,并将所述授权码发送至用户中心后,从所述用户中心获取得到关于所述授权码的访问令牌;
步骤S202,包括:对所述访问令牌进行验证,如果所述访问令牌验证通过,则将关于所述用户账号的用户信息发送至所述设备,所述用户信息由所述设备用于回调至所述第三方应用。
本实施例应用于服务器中,服务器对访问令牌进行验证后返回用户账号的用户信息。
在其中一个实施例中,还包括,授权码发送步骤;
所述授权码发送步骤,包括:
接收到设备判断没有与所述设备绑定的用户账号时,所发送的应用标识和应用密钥,所述应用标识和所述应用密钥为所述设备所获取的所述第三方应用的应用标识和应用密钥;
如果所述应用标识和所述应用密钥验证通过则向所述设备返回登陆页面,并通过所述登陆页面获取用户账号和用户密码;
如果对所述用户账号和所述用户密码验证通过,则向所述设备返回关于所述用户账号的授权码。
本实施例的步骤处理了用户在采用不预先绑定用户账号的设备时的登陆请求,并返回相应的授权码。
如图8所示为本发明的最佳实施例的针对预先绑定用户账号的设备的工作流程图,设备为手机,具体包括:
开发者采用本发明实施例所提供的sdk时,首先需要在服务器申请授权的应用标识(appid)、应用密钥(appsecret)、openid和secret_key。
步骤S801,将appid,appsecret传给置于手机rom的代理agent, 如果appid与appsecret验证成功,直接打开登录界面,进行授权登录,登录成功将获得由agent返回的授权码(code),具体来说:
将openid与secret_key传给agent的GuideActivity,根据startActivityForResult去启动内置在手机rom里面的com.letv.android.agent.GuideActivity页面,如果该页面授权成功会在onActivityResult中将code通过Intent回传,取到code之后,调用getAccessToken(code)来换取用户的accesstoken;
步骤S802,通过http发送到用户中心,用户中心再根据该授权码,把对应该授权码的用户的访问令牌(accesstoken)返回,具体来说:
将开发者传入的appid、appsecrect、授权码code、回调地址组合,成为一个json字串,通过HttpClient的POST发送getAccessTokenFromServer请求到用户中心,然后用RequestCallback的接口回调从用户中心取到返回的Json字段,对其用JSONObject解析,取到accesstoken、uid字段;
步骤S803,通过accesstoken,取得用户的账户信息,具体来说:
将accesstoken、uid传入getUserBasicInfo方法,在getUserBasicInfo方法中,将appid、uid、accesstoken、uid组合成一个json字符串,同理根据HttpClient的Get发送getUserBasicInfoFromServer请求,取得用户的基本信息,返回信息包括:uid、nickname、accesstoken、file_300*300、file_200*200、file_70*70、file_50*50。
然后将这些信息组合到回调接口中;
步骤S804,取得用户信息之后,通过android的shareprefer,将accesstoken以及uid、nickname等存储到本地存储,将uid作为主键,如果是根据历史直接点击登录,则会取到所有shareprefer中的用户信息,进行展示,然后根据该用户信息取到用户的accesstoken,然后执行步骤S803,取到用户信息,将信息回调出去。
步骤S805,通过sdk提供的回调接口,将信息回传给第三方应用进行账户信息处理,回调接口将用户信息封装成HashMap,然后开发者直接可以直接对HashMap对象进行操作,具体来说:
其封装格式为:
HashMap<String,Object>userInfo=new HashMap<String,Object>()
userInfo.put("letv_uid",/*用户uid*/);
userInfo.put("nickname",/*昵称*/);
userInfo.put("access_token",/*授权access token*/);
userInfo.put("file_300*300",/*300*300头像*/);
userInfo.put("file_200*200",/*200*200头像*/);
userInfo.put("file_70*70",/*70*70头像*/);
userInfo.put("file_50*50",/*50*50头像*/);
然后将该HashMap对象直接回调给开发者。
本发明的最佳实施例的针对非预先绑定用户账号的设备,具体包括:
调用html5的登录页面,输入账户跟密码,点击登录,登录成功后在回调地址里会回传授权码code,然后后续与针对预先绑定用户账号的设备的工作流程相同,即与步骤S802~S805一致,其登陆页面的生成,具体如下:
根据appid,appsecret及回调地址,拼出来一个调起登录的url,其格式如下:
"https://aaa.xxx.com/oauthopen/authorize?scope=user_basic_show&display=mobile&client_id="
+AccountOathSDK.appid+"&force_login=1&state=&response_type=code&client_secret="
+AccountOathSDK.appsecret+"&redirect_uri="+AccountOathSDK.redirect_uri;
然后通过WebView的loadurl来打开该登录页面,如果登录成功,则会将授权码code附在回调地址redirect_uri后面,如https://aaa.xxx.com/oauth_default.html?code=1,然后通过WebView的onPageFinish方法,可以截取到code值,将该值传入getAccessToken(code)中。
本发明最佳实施例的sdk由于资源文件在jar中用R文件直接访 问会有冲突,所以所有资源文件的访问都采用java的反射机制来获得。具体提供一个Mresource类以根据资源类的类名(className)以及资源文件名(name)来获取资源文件id。
在Mresource中会提供一个getIdByName(Context context,String className,String name),该方法会根据className以及id名称name来取得对应的id。会先根据包名(package name)来反射出对应的R文件,然后在该R文件中遍历类,如果找到该资源类,则把该资源类中对用的name值所对应的id直接返回。
Figure PCTCN2016088564-appb-000001
如图3所示为本发明实施例的一种第三方账号授权设备的结构模块图,包括:
第三方授权响应模块301,用于:响应第三方应用的授权请求;
授权码获取模块302,用于:如果设有预先绑定的用户账号,则获取关于所述预先绑定的用户账号的授权码;
访问令牌获取模块303,用于:将所述授权码发送至用户中心,从所述用户中心获取关于所述授权码的访问令牌;
用户信息获取模块304,用于:将所述访问令牌和用户账号发送到服务器,从所述服务器获取在所述访问令牌验证通过后的关于所述用户账号的用户信息;
信息回调模块305,用于:将所述用户信息回调至所述第三方应 用。
在其中一个实施例中,所述获取关于所述预先绑定的用户账号的授权码,具体用于:
获取所述第三方应用的应用标识和应用密钥;
对所述应用标识和所述应用密钥进行验证,如果验证通过,获取关于所述预先绑定的用户账号的授权码。
在其中一个实施例中,所述授权码获取模块302,还用于:如果没有预先绑定的用户账号,则:
获取所述第三方应用的应用标识和应用密钥;
将所述应用标识和所述应用密钥发送到服务器;
显示所述服务器对所述应用标识和所述应用密钥进行验证后所返回的登陆页面;
获取所述服务器对用户账号和用户密码验证通过后所返回的关于所述用户账号的授权码,执行访问令牌获取模块,所述用户账号和所述用户密码由所述服务器通过所述登陆页面接收得到。
在其中一个实施例中,所述访问令牌获取模块303中,获取所述访问令牌后与所述用户账号关联保存;
所述第三方授权响应模块301,具体用于:
当响应于第三方应用的授权请求时,如果保存有与所述用户账号关联保存的访问令牌,则直接执行所述用户信息获取模块304,否则执行所述授权码获取模块302。
在其中一个实施例中,所述信息回调模块305,具体用于:
将所述用户信息进行哈希封装后回调至所述第三方应用。
在其中一个实施例中,所述第三方授权响应模块301,具体用于:显示授权页面,响应由所述授权页面所触发的第三方应用的授权请求,所述授权页面采用Java基于安卓系统生成,且所述授权页面的显示资源来自以Java库形式保存的至少一个资源文件,且每个所述资源文件的资源文件标识采用Java的反射机制从安卓系统所提供的R文件中获取。
如图4所示为本发明实施例的设备的结构框图,其主要包括:处 理器401、存储器402、通信组件403及显示屏404等。一般来说,本发明的设备优选为智能手机、平板电脑和智能电视等。
其中存储器402中存储前述方法的具体代码,由处理器401具体执行,通过显示屏404显示授权界面,以及通过通信组件403向服务器发送访问令牌和用户账号,以及接收用户信息并通过处理器401回调至第三方应用。
如图5所示为本发明实施例的一种第三方账号授权服务器的结构模块图,包括:
访问令牌接收模块501,用于:接收到来自设备的访问令牌和用户账号,所述访问令牌由所述设备响应第三方应用的授权请求,在设有预先绑定的用户账号时获取关于所述预先绑定的用户账号的授权码,并将所述授权码发送至用户中心后,从所述用户中心获取得到关于所述授权码的访问令牌;
用户信息发送模块502,用于:对所述访问令牌进行验证,如果所述访问令牌验证通过,则将关于所述用户账号的用户信息发送至所述设备,所述用户信息由所述设备用于回调至所述第三方应用。
在其中一个实施例中,还包括,授权码发送模块;
所述授权码发送模块,用于:
接收到设备判断没有与所述设备绑定的用户账号时,所发送的应用标识和应用密钥,所述应用标识和所述应用密钥为所述设备所获取的所述第三方应用的应用标识和应用密钥;
如果所述应用标识和所述应用密钥验证通过则向所述设备返回登陆页面,并通过所述登陆页面获取用户账号和用户密码;
如果对所述用户账号和所述用户密码验证通过,则向所述设备返回关于所述用户账号的授权码。
如图6所示为本发明实施例的服务器的结构框图。服务器可以为一台电脑,也可以是多台电脑所组成的集群,其主要包括:处理器601、存储器602以及通信组件603等。
其中存储器602中存储前述方法的具体代码,由处理器601具体执行,通过通信组件603接收设备发送的访问令牌和用户账号,并由 处理器601从存储器602中查询得到用户信息后,通过通信组件603向设备返回用户信息。
如图7所示为本发明实施例的一种第三方账号授权系统的结构模块图,包括:设备端71和服务器端72;
所述设备端71,包括:
设备端第三方授权响应模块711,用于:响应第三方应用的授权请求;
设备端授权码获取模块712,用于:如果设有预先绑定的用户账号,则获取关于所述预先绑定的用户账号的授权码;
设备端访问令牌获取模块713,用于:将所述授权码发送至用户中心,从所述用户中心获取关于所述授权码的访问令牌;
设备端用户信息获取模块714,用于:将所述访问令牌和用户账号发送到服务器,从所述服务器获取关于所述用户账号的用户信息;
设备端信息回调模块715,用于:将所述用户信息回调至所述第三方应用;
所述服务器端72,包括:
服务器端访问令牌接收模块721,用于:接收到来自设备的访问令牌和用户账号;
服务器端用户信息发送模块722,用于:对所述访问令牌进行验证,如果所述访问令牌验证通过,则将关于所述用户账号的用户信息发送至所述设备。
以上所述实施例仅表达了本发明的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对本发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本发明构思的前提下,还可以做出若干变形和改进,这些都属于本发明的保护范围。因此,本发明专利的保护范围应以所附权利要求为准。

Claims (21)

  1. 一种第三方账号授权方法,其特征在于,包括:
    响应第三方应用的授权请求;
    如果设有预先绑定的用户账号,则获取关于所述预先绑定的用户账号的授权码;
    将所述授权码发送至用户中心,从所述用户中心获取关于所述授权码的访问令牌;
    将所述访问令牌和用户账号发送到服务器,从所述服务器获取在所述访问令牌验证通过后的关于所述用户账号的用户信息;
    将所述用户信息回调至所述第三方应用。
  2. 根据权利要求1所述的第三方账号授权方法,其特征在于,所述获取关于所述预先绑定的用户账号的授权码,具体包括:
    获取所述第三方应用的应用标识和应用密钥;
    对所述应用标识和所述应用密钥进行验证,如果验证通过,获取关于所述预先绑定的用户账号的授权码。
  3. 根据权利要求1所述的第三方账号授权方法,其特征在于,在所述如果设有预先绑定的用户账号,则获取关于所述预先绑定的用户账号的授权码之后,所述方法还包括:
    如果没有预先绑定的用户账号,则:
    获取所述第三方应用的应用标识和应用密钥;
    将所述应用标识和所述应用密钥发送到服务器;
    显示所述服务器对所述应用标识和所述应用密钥进行验证后所返回的登陆页面;
    获取所述服务器对用户账号和用户密码验证通过后所返回的关于所述用户账号的授权码,将所述授权码发送至用户中心,从所述用户中心获取关于所述授权码的访问令牌,所述用户账号和所述用户密码由所述服务器通过所述登陆页面接收得到。
  4. 根据权利要求1所述的第三方账号授权方法,其特征在于,在所述将所述授权码发送至用户中心,从所述用户中心获取关于所述授 权码的访问令牌之后,所述方法还包括:获取所述访问令牌后与所述用户账号关联保存;
    所述响应第三方应用的授权请求,具体包括:
    当响应于第三方应用的授权请求时,如果保存有与所述用户账号关联保存的访问令牌,则直接将所述访问令牌和用户账号发送到服务器,从所述服务器获取在所述访问令牌验证通过后的关于所述用户账号的用户信息,否则如果设有预先绑定的用户账号,则获取关于所述预先绑定的用户账号的授权码。
  5. 根据权利要求1所述的第三方账号授权方法,其特征在于,所述将所述用户信息回调至所述第三方应用,具体包括:
    将所述用户信息进行哈希封装后回调至所述第三方应用。
  6. 根据权利要求1~5任一项所述的第三方账号授权方法,其特征在于,所述响应第三方应用的授权请求,具体包括:显示授权页面,响应由所述授权页面所触发的第三方应用的授权请求,所述授权页面采用Java基于安卓系统生成,且所述授权页面的显示资源来自以Java库形式保存的至少一个资源文件,且每个所述资源文件的资源文件标识采用Java的反射机制从安卓系统所提供的R文件中获取。
  7. 一种计算机程序,其特征在于,包括在计算机上运行时,适合执行如权利要求1~6任一项所述的第三方账号授权方法的所有步骤的计算机代码。
  8. 根据权利要求7所述的计算机程序,其特征在于,所述计算机程序收录在计算机可读媒介上。
  9. 一种第三方账号授权方法,其特征在于,包括:
    接收到来自设备的访问令牌和用户账号,所述访问令牌由所述设备响应第三方应用的授权请求,在设有预先绑定的用户账号时获取关于所述预先绑定的用户账号的授权码,并将所述授权码发送至用户中心后,从所述用户中心获取得到关于所述授权码的访问令牌;
    对所述访问令牌进行验证,如果所述访问令牌验证通过,则将关于所述用户账号的用户信息发送至所述设备,所述用户信息由所述设备用于回调至所述第三方应用。
  10. 根据权利要求9所述的第三方账号授权方法,其特征在于,所述方法,还包括:
    接收到设备判断没有与所述设备绑定的用户账号时,所发送的应用标识和应用密钥,所述应用标识和所述应用密钥为所述设备所获取的所述第三方应用的应用标识和应用密钥;
    如果所述应用标识和所述应用密钥验证通过则向所述设备返回登陆页面,并通过所述登陆页面获取用户账号和用户密码;
    如果对所述用户账号和所述用户密码验证通过,则向所述设备返回关于所述用户账号的授权码。
  11. 一种计算机程序,其特征在于,包括在计算机上运行时,适合执行如权利要求9或10所述的第三方账号授权方法的所有步骤的计算机代码。
  12. 根据权利要求11所述的计算机程序,其特征在于,所述计算机程序收录在计算机可读媒介上。
  13. 一种第三方账号授权设备,其特征在于,包括:
    第三方授权响应模块,用于:响应第三方应用的授权请求;
    授权码获取模块,用于:如果设有预先绑定的用户账号,则获取关于所述预先绑定的用户账号的授权码;
    访问令牌获取模块,用于:将所述授权码发送至用户中心,从所述用户中心获取关于所述授权码的访问令牌;
    用户信息获取模块,用于:将所述访问令牌和用户账号发送到服务器,从所述服务器获取在所述访问令牌验证通过后的关于所述用户账号的用户信息;
    信息回调模块,用于:将所述用户信息回调至所述第三方应用。
  14. 根据权利要求13所述的第三方账号授权设备,其特征在于,所述获取关于所述预先绑定的用户账号的授权码,具体用于:
    获取所述第三方应用的应用标识和应用密钥;
    对所述应用标识和所述应用密钥进行验证,如果验证通过,获取关于所述预先绑定的用户账号的授权码。
  15. 根据权利要求13所述的第三方账号授权设备,其特征在于, 所述授权码获取模块,还用于:如果没有预先绑定的用户账号,则:
    获取所述第三方应用的应用标识和应用密钥;
    将所述应用标识和所述应用密钥发送到服务器;
    显示所述服务器对所述应用标识和所述应用密钥进行验证后所返回的登陆页面;
    获取所述服务器对用户账号和用户密码验证通过后所返回的关于所述用户账号的授权码,执行访问令牌获取模块,所述用户账号和所述用户密码由所述服务器通过所述登陆页面接收得到。
  16. 根据权利要求13所述的第三方账号授权设备,其特征在于,所述访问令牌获取模块中,获取所述访问令牌后与所述用户账号关联保存;
    所述第三方授权响应模块,具体用于:
    当响应于第三方应用的授权请求时,如果保存有与所述用户账号关联保存的访问令牌,则直接执行所述用户信息获取模块,否则执行所述授权码获取模块。
  17. 根据权利要求13所述的第三方账号授权设备,其特征在于,所述信息回调模块,具体用于:
    将所述用户信息进行哈希封装后回调至所述第三方应用。
  18. 根据权利要求13~17任一项所述的第三方账号授权设备,其特征在于,所述第三方授权响应模块,具体用于:显示授权页面,响应由所述授权页面所触发的第三方应用的授权请求,所述授权页面采用Java基于安卓系统生成,且所述授权页面的显示资源来自以Java库形式保存的至少一个资源文件,且每个所述资源文件的资源文件标识采用Java的反射机制从安卓系统所提供的R文件中获取。
  19. 一种第三方账号授权服务器,其特征在于,包括:
    访问令牌接收模块,用于:接收到来自设备的访问令牌和用户账号,所述访问令牌由所述设备响应第三方应用的授权请求,在设有预先绑定的用户账号时获取关于所述预先绑定的用户账号的授权码,并将所述授权码发送至用户中心后,从所述用户中心获取得到关于所述授权码的访问令牌;
    用户信息发送模块,用于:对所述访问令牌进行验证,如果所述访问令牌验证通过,则将关于所述用户账号的用户信息发送至所述设备,所述用户信息由所述设备用于回调至所述第三方应用。
  20. 根据权利要求19所述的第三方账号授权服务器,其特征在于,还包括,授权码发送模块;
    所述授权码发送模块,用于:
    接收到设备判断没有与所述设备绑定的用户账号时,所发送的应用标识和应用密钥,所述应用标识和所述应用密钥为所述设备所获取的所述第三方应用的应用标识和应用密钥;
    如果所述应用标识和所述应用密钥验证通过则向所述设备返回登陆页面,并通过所述登陆页面获取用户账号和用户密码;
    如果对所述用户账号和所述用户密码验证通过,则向所述设备返回关于所述用户账号的授权码。
  21. 一种第三方账号授权系统,其特征在于,包括:如权利要求13~18任一项所述的设备端和如权利要求19~20任一项所述的服务器端。
PCT/CN2016/088564 2015-10-22 2016-07-05 一种第三方账号授权方法、设备、服务器及其系统 WO2017067227A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510694688.2 2015-10-22
CN201510694688.2A CN105897668A (zh) 2015-10-22 2015-10-22 一种第三方账号授权方法、设备、服务器及其系统

Publications (1)

Publication Number Publication Date
WO2017067227A1 true WO2017067227A1 (zh) 2017-04-27

Family

ID=57001786

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/088564 WO2017067227A1 (zh) 2015-10-22 2016-07-05 一种第三方账号授权方法、设备、服务器及其系统

Country Status (2)

Country Link
CN (1) CN105897668A (zh)
WO (1) WO2017067227A1 (zh)

Cited By (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109474662A (zh) * 2018-09-25 2019-03-15 中国平安人寿保险股份有限公司 产品数据发布方法、装置、计算机设备和存储介质
CN111756753A (zh) * 2020-06-28 2020-10-09 中国平安财产保险股份有限公司 一种权限验证方法及系统
CN111970298A (zh) * 2020-08-26 2020-11-20 腾讯科技(深圳)有限公司 应用访问方法、装置、存储介质及计算机设备
CN112039826A (zh) * 2019-06-03 2020-12-04 北京京东尚科信息技术有限公司 一种应用于小程序端的登录方法和装置
CN112464175A (zh) * 2020-11-11 2021-03-09 中国建设银行股份有限公司 脚本审核执行方法、系统、设备和存储介质
CN112738805A (zh) * 2020-12-30 2021-04-30 青岛海尔科技有限公司 设备控制方法和装置、存储介质及电子设备
CN112887298A (zh) * 2021-01-22 2021-06-01 湖南金鹰卡通传媒有限公司 多账号体系管理数据同步方法、存储介质以及系统
CN112953965A (zh) * 2021-03-18 2021-06-11 杭州网易云音乐科技有限公司 客户端登录方法及系统、客户端、介质、计算设备
CN113435898A (zh) * 2021-07-09 2021-09-24 支付宝(杭州)信息技术有限公司 数据处理方法以及系统
CN113516376A (zh) * 2021-06-23 2021-10-19 广东博力威科技股份有限公司 电池管理系统及终端设备
CN113746857A (zh) * 2021-09-09 2021-12-03 深圳市腾讯网域计算机网络有限公司 登录方法、装置、设备及计算机可读存储介质
CN114185702A (zh) * 2021-12-13 2022-03-15 中国平安财产保险股份有限公司 共享应用的跨平台调用方法、装置、设备及存储介质
CN114331402A (zh) * 2022-03-01 2022-04-12 飞狐信息技术(天津)有限公司 一种提现方法及装置
CN114553433A (zh) * 2022-02-15 2022-05-27 网易(杭州)网络有限公司 一种第三方平台访问方法、装置、电子设备和介质
CN114640472A (zh) * 2022-03-22 2022-06-17 湖南快乐阳光互动娱乐传媒有限公司 一种受保护资源数据的获取方法、装置和统一开放平台
CN114697056A (zh) * 2020-12-28 2022-07-01 航天信息股份有限公司 开票系统的登录方法、装置、存储介质和电子设备
CN115102711A (zh) * 2022-05-09 2022-09-23 支付宝(杭州)信息技术有限公司 信息授权方法、装置以及系统

Families Citing this family (38)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106534072B (zh) * 2016-10-13 2019-12-10 腾讯科技(深圳)有限公司 用户信息授权方法、装置、设备及系统
CN106652227B (zh) * 2016-10-14 2020-03-27 中国银联股份有限公司 一种智能汽车支付系统以及支付方法
CN108234401B (zh) * 2016-12-15 2020-09-11 腾讯科技(深圳)有限公司 一种对业务系统授权的方法及装置
WO2018113130A1 (zh) * 2016-12-22 2018-06-28 华为技术有限公司 应用程序授权方法、终端及服务器
CN106790122A (zh) * 2016-12-27 2017-05-31 努比亚技术有限公司 一种终端、服务器和接入应用时的登录方法
CN107147647B (zh) * 2017-05-11 2021-01-08 腾讯科技(深圳)有限公司 一种网页授权方法及装置
CN107277067B (zh) * 2017-08-11 2020-10-23 四川长虹电器股份有限公司 基于统一开发者账号的第三方系统对接方法
CN109660487B (zh) * 2017-10-10 2021-11-09 武汉斗鱼网络科技有限公司 基于h5网页的授权方法、存储介质、电子设备及系统
CN107896227A (zh) * 2017-12-14 2018-04-10 珠海格力电器股份有限公司 一种数据调用方法、装置及设备数据云平台
CN108347471B (zh) * 2018-01-02 2021-07-23 武汉斗鱼网络科技有限公司 获取第三方用户信息的方法、装置及系统
CN108683648A (zh) * 2018-05-02 2018-10-19 珠海横琴盛达兆业科技投资有限公司 一种基于微信小程序与服务器之间通过不断地变换验证码来实现安全通信的方法
CN109190352B (zh) * 2018-07-03 2022-05-17 创新先进技术有限公司 一种授权文本准确性验证方法和装置
CN109274726B (zh) * 2018-08-31 2020-07-07 阿里巴巴集团控股有限公司 绑定、迁移方法和装置、计算设备及存储介质
CN109218298A (zh) * 2018-09-04 2019-01-15 中钞信用卡产业发展有限公司杭州区块链技术研究院 一种应用数据访问方法及系统
CN109388917B (zh) * 2018-10-12 2022-03-18 彩讯科技股份有限公司 硬件设备的鉴权方法、装置、设备及存储介质
CN111193691B (zh) * 2018-11-15 2022-05-24 中国电信股份有限公司 授权方法、系统和相关设备
CN109474600B (zh) * 2018-11-20 2021-06-18 麒麟合盛网络技术股份有限公司 一种账号绑定方法、系统、装置及其设备
CN109962911A (zh) * 2019-02-19 2019-07-02 深圳点猫科技有限公司 一种通过小程序获取用户信息的方法及电子设备
CN111835677B (zh) * 2019-04-17 2022-03-22 北京世纪好未来教育科技有限公司 一种用户信息的获取方法、装置及计算机存储介质
CN110166461B (zh) * 2019-05-24 2022-09-20 中国银联股份有限公司 用户统一标识处理方法、装置、设备及存储介质
CN110336720B (zh) * 2019-06-29 2021-08-20 华为技术有限公司 设备控制方法和设备
CN110414207A (zh) * 2019-07-31 2019-11-05 咪付(深圳)网络技术有限公司 一种app接口权限控制方法
CN112738143B (zh) * 2019-10-14 2022-05-10 华为技术有限公司 一种账号绑定方法、设备及系统
CN110856145B (zh) * 2019-10-23 2023-04-18 杭州博联智能科技股份有限公司 基于近场认证的iot设备与用户绑定方法、设备及介质
CN110677248B (zh) * 2019-10-30 2022-09-30 宁波奥克斯电气股份有限公司 一种基于窄带物联网的安全绑定方法和系统
CN110990796B (zh) * 2019-11-26 2022-02-11 广州至真信息科技有限公司 一种应用处理方法、装置、应用服务器和存储介质
CN111193725B (zh) * 2019-12-20 2022-04-05 北京淇瑀信息科技有限公司 一种基于配置的联合登录方法、装置和计算机设备
CN111241555B (zh) * 2019-12-30 2022-07-12 北京顺达同行科技有限公司 模拟用户登录的访问方法、装置、计算机设备和存储介质
CN111177690B (zh) * 2019-12-31 2022-07-05 中国工商银行股份有限公司 一种二维码扫码登录方法及装置
CN111861457B (zh) * 2020-06-28 2023-02-21 中国银联股份有限公司 支付令牌申请方法、设备、系统和服务器
CN113766496B (zh) * 2021-08-30 2024-01-26 青岛海尔科技有限公司 智能设备的跨平台绑定方法、系统及相关设备
CN113766503B (zh) * 2021-08-31 2023-10-24 青岛海尔科技有限公司 智能设备的绑定方法、系统及相关设备
CN113824618B (zh) * 2021-09-16 2023-06-06 珠海格力电器股份有限公司 跨平台的设备配网方法、第二方平台和第一方平台
CN113660100B (zh) * 2021-10-21 2022-01-18 飞天诚信科技股份有限公司 生成软令牌种子的方法、系统和电子设备
CN114189362B (zh) * 2021-11-23 2023-12-19 中国银联股份有限公司 账号登录方法、终端、服务器、系统及介质
CN114338224B (zh) * 2022-01-17 2024-04-12 广东好太太智能家居有限公司 一种智能硬件跨平台控制方法及系统
CN115412331B (zh) * 2022-08-25 2024-08-23 聚好看科技股份有限公司 一种应用登录方法、电子设备及服务器
CN117240608B (zh) * 2023-11-10 2024-03-29 腾讯科技(深圳)有限公司 登录授权方法、装置、计算机设备和存储介质

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130054968A1 (en) * 2011-08-29 2013-02-28 Salesforce.Com Inc. Methods and systems of data security in browser storage
CN103888451A (zh) * 2014-03-10 2014-06-25 百度在线网络技术(北京)有限公司 认证的授权方法、装置及系统
CN104917721A (zh) * 2014-03-10 2015-09-16 腾讯科技(北京)有限公司 基于oAuth协议的授权方法、装置和系统

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103067381B (zh) * 2012-12-26 2015-11-25 百度在线网络技术(北京)有限公司 使用平台方账号登录第三方服务的方法、系统和装置
CN104753672B (zh) * 2013-12-30 2019-01-22 腾讯科技(深圳)有限公司 账号授权的方法、装置及终端

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130054968A1 (en) * 2011-08-29 2013-02-28 Salesforce.Com Inc. Methods and systems of data security in browser storage
CN103888451A (zh) * 2014-03-10 2014-06-25 百度在线网络技术(北京)有限公司 认证的授权方法、装置及系统
CN104917721A (zh) * 2014-03-10 2015-09-16 腾讯科技(北京)有限公司 基于oAuth协议的授权方法、装置和系统

Cited By (25)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109474662A (zh) * 2018-09-25 2019-03-15 中国平安人寿保险股份有限公司 产品数据发布方法、装置、计算机设备和存储介质
CN109474662B (zh) * 2018-09-25 2023-04-07 中国平安人寿保险股份有限公司 产品数据发布方法、装置、计算机设备和存储介质
CN112039826A (zh) * 2019-06-03 2020-12-04 北京京东尚科信息技术有限公司 一种应用于小程序端的登录方法和装置
CN111756753A (zh) * 2020-06-28 2020-10-09 中国平安财产保险股份有限公司 一种权限验证方法及系统
CN111970298A (zh) * 2020-08-26 2020-11-20 腾讯科技(深圳)有限公司 应用访问方法、装置、存储介质及计算机设备
CN111970298B (zh) * 2020-08-26 2024-01-05 腾讯科技(深圳)有限公司 应用访问方法、装置、存储介质及计算机设备
CN112464175A (zh) * 2020-11-11 2021-03-09 中国建设银行股份有限公司 脚本审核执行方法、系统、设备和存储介质
CN114697056A (zh) * 2020-12-28 2022-07-01 航天信息股份有限公司 开票系统的登录方法、装置、存储介质和电子设备
CN112738805A (zh) * 2020-12-30 2021-04-30 青岛海尔科技有限公司 设备控制方法和装置、存储介质及电子设备
CN112738805B (zh) * 2020-12-30 2022-12-06 青岛海尔科技有限公司 设备控制方法和装置、存储介质及电子设备
CN112887298A (zh) * 2021-01-22 2021-06-01 湖南金鹰卡通传媒有限公司 多账号体系管理数据同步方法、存储介质以及系统
CN112887298B (zh) * 2021-01-22 2022-08-30 湖南金鹰卡通传媒有限公司 多账号体系管理数据同步方法、存储介质以及系统
CN112953965A (zh) * 2021-03-18 2021-06-11 杭州网易云音乐科技有限公司 客户端登录方法及系统、客户端、介质、计算设备
CN112953965B (zh) * 2021-03-18 2022-11-01 杭州网易云音乐科技有限公司 客户端登录方法及系统、客户端、介质、计算设备
CN113516376A (zh) * 2021-06-23 2021-10-19 广东博力威科技股份有限公司 电池管理系统及终端设备
CN113435898A (zh) * 2021-07-09 2021-09-24 支付宝(杭州)信息技术有限公司 数据处理方法以及系统
CN113746857A (zh) * 2021-09-09 2021-12-03 深圳市腾讯网域计算机网络有限公司 登录方法、装置、设备及计算机可读存储介质
CN114185702A (zh) * 2021-12-13 2022-03-15 中国平安财产保险股份有限公司 共享应用的跨平台调用方法、装置、设备及存储介质
CN114553433A (zh) * 2022-02-15 2022-05-27 网易(杭州)网络有限公司 一种第三方平台访问方法、装置、电子设备和介质
CN114553433B (zh) * 2022-02-15 2023-09-08 网易(杭州)网络有限公司 一种第三方平台访问方法、装置、电子设备和介质
CN114331402A (zh) * 2022-03-01 2022-04-12 飞狐信息技术(天津)有限公司 一种提现方法及装置
CN114331402B (zh) * 2022-03-01 2022-07-08 飞狐信息技术(天津)有限公司 一种提现方法及装置
CN114640472A (zh) * 2022-03-22 2022-06-17 湖南快乐阳光互动娱乐传媒有限公司 一种受保护资源数据的获取方法、装置和统一开放平台
CN115102711A (zh) * 2022-05-09 2022-09-23 支付宝(杭州)信息技术有限公司 信息授权方法、装置以及系统
CN115102711B (zh) * 2022-05-09 2024-01-02 支付宝(杭州)信息技术有限公司 信息授权方法、装置以及系统

Also Published As

Publication number Publication date
CN105897668A (zh) 2016-08-24

Similar Documents

Publication Publication Date Title
WO2017067227A1 (zh) 一种第三方账号授权方法、设备、服务器及其系统
US11316689B2 (en) Trusted token relay infrastructure
US10104079B2 (en) Authentication proxy agent
US10484462B2 (en) Dynamic registration of an application with an enterprise system
US10075426B2 (en) Web-based single sign-on with form-fill proxy application
US10009335B2 (en) Global unified session identifier across multiple data centers
CN106716404B (zh) 计算机子网内的代理服务器
WO2016127797A1 (zh) 用户信息获取方法、装置及服务器
US9866640B2 (en) Cookie based session management
JP5881687B2 (ja) オープン・アプリケーション・プログラミング・インターフェースに基づくオンライン・ビジネス法、システム、並びに、装置
US11693945B2 (en) Secure calls between applications
US9654462B2 (en) Late binding authentication
CN115021991A (zh) 未经管理的移动设备的单点登录
US9473479B2 (en) Automating authentication with multi-channel media distributors
US10616209B2 (en) Preventing inter-application message hijacking
JP6640869B2 (ja) スマートイメージを使用したフィッシング対策のための方法およびシステム
US11121863B1 (en) Browser login sessions via non-extractable asymmetric keys
JPWO2009107219A1 (ja) 認証装置,認証方法およびその方法を実装した認証プログラム
WO2015192582A1 (zh) 虚拟桌面登录验证方法和装置
CN112491778A (zh) 认证方法、装置、系统及介质
JP6343900B2 (ja) 通信端末、通信処理方法および通信処理プログラム
CN105141586A (zh) 一种对用户进行验证的方法和系统
US11474840B1 (en) Computing device and related methods providing virtual session launching from previously cached assets
WO2016179860A1 (zh) 一种多操作系统终端中位置信息的保护方法、装置及终端
WO2022246343A1 (en) Computing device and related methods providing virtual session launching from previously cached assets

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16856666

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16856666

Country of ref document: EP

Kind code of ref document: A1