WO2016029595A1 - 开放平台的调用方法、装置、设备及非易失性计算机存储介质 - Google Patents

开放平台的调用方法、装置、设备及非易失性计算机存储介质 Download PDF

Info

Publication number
WO2016029595A1
WO2016029595A1 PCT/CN2014/093750 CN2014093750W WO2016029595A1 WO 2016029595 A1 WO2016029595 A1 WO 2016029595A1 CN 2014093750 W CN2014093750 W CN 2014093750W WO 2016029595 A1 WO2016029595 A1 WO 2016029595A1
Authority
WO
WIPO (PCT)
Prior art keywords
application
information
signature
open platform
identification information
Prior art date
Application number
PCT/CN2014/093750
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 WO2016029595A1 publication Critical patent/WO2016029595A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems

Definitions

  • the present invention relates to authorization technologies, and in particular, to an open platform calling method, apparatus, device, and non-volatile computer storage medium.
  • the website's services are packaged into a series of machine-readable data interfaces that are open for use by third-party developers.
  • This behavior is called the Open Application Programming Interface (API) and provides openness.
  • the platform of the API itself is called the Open Platform.
  • the open API provided by most open platforms, when invoked by a third-party application, requires a third-party application to obtain an access token through an authorization mechanism provided by the open platform, which may also be referred to as an access authorization code.
  • an authorization code provided by the open platform
  • the access token needs to be carried, so that the open platform can provide corresponding access rights to the third-party application according to the access token.
  • the application can use the application identification information and the key information allocated by the application open platform for the application, and request the access token from the open platform, and the security is not high.
  • aspects of the present invention provide an open platform calling method, apparatus, device, and non-volatile computer storage medium for improving security of a call of a security platform.
  • An aspect of the present invention provides a method for invoking an open platform, including:
  • an access token which is used to invoke an open API provided by the open platform, where the access token uses the second signature information for the open platform to verify the first signature information. Obtained, the second signature information is obtained by the open platform for performing signature processing on the identifier information registered by the application, and the identifier information of the application registration is obtained by the open platform according to the application identifier information. of.
  • the acquiring the identity identification information of the application includes:
  • the identity identification information includes at least one of a package name and a package signature.
  • the method before the signing the identity identification information to obtain the first signature information of the application, the method further includes:
  • the sending the first signature information and the application identifier information of the application to the open platform including:
  • the second signature information is obtained by the open platform signing the identity information and the network timestamp registered by the application, and the identity information of the application registration is the open platform according to the network.
  • the timestamp and the application identification information are obtained.
  • an apparatus for invoking an open platform including:
  • An obtaining unit configured to acquire identity information of the application
  • a signature unit configured to perform signature processing on the identity identification information to obtain the response First signature information used
  • a sending unit configured to send the first signature information and application identifier information of the application to an open platform
  • a receiving unit configured to receive an access token sent by the open platform, to invoke an open API provided by the open platform, where the access token uses the second signature information for the open platform, and the first After the signature information is successfully verified, the second signature information is obtained by the open platform signing the identity information registered by the application, and the identifier information of the application registration is the open platform according to the The application identification information is obtained.
  • any possible implementation manner further provide an implementation manner, where the acquiring unit is specifically configured to
  • any possible implementation manner further provide an implementation manner, where the acquiring unit is specifically configured to
  • the identity identification information includes at least one of a package name and a package signature.
  • the obtaining unit is further used for
  • the signature unit is specifically used for
  • the sending unit is specifically configured to
  • the second signature information is obtained by the open platform signing the identity information and the network timestamp registered by the application, and the identity information of the application registration is the open platform according to the network.
  • the timestamp and the application identification information are obtained.
  • an apparatus comprising:
  • One or more processors are One or more processors;
  • One or more programs the one or more programs being stored in the memory, when executed by the one or more processors:
  • the access token is obtained by using the second signature information by the open platform, and the second signature information is obtained after the first signature information is successfully verified, and the second signature information is used by the open platform to register the application.
  • the identity identification information obtained by the signature processing is obtained by the application platform according to the application identification information.
  • a nonvolatile computer storage medium storing one or more programs when the one or more programs are executed by a device causes The device:
  • an access token which is used to invoke an open API provided by the open platform, where the access token uses the second signature information for the open platform to verify the first signature information. Obtained, the second signature information is obtained by the open platform for performing signature processing on the identifier information registered by the application, and the identifier information of the application registration is obtained by the open platform according to the application identifier information. of.
  • the embodiment of the present invention obtains the identity identification information of the application, and then performs signature processing on the identity identification information to obtain the first signature information of the application, and sends the first signature to the open platform.
  • the information and the application identification information of the application enable the access token sent by the open platform to be used to invoke the open API provided by the open platform, and the security platform is improved because the verification parameters of the plaintext are not transmitted. The security of the call.
  • the security problem caused by the leakage of the verification parameter can be avoided, and the security of the call of the security platform can be further improved.
  • the server corresponding to the application and the application does not need to store the key information, and the security problem caused by the leakage of the verification parameter can be avoided, and the security of the call of the security platform can be further improved.
  • the interface provided by the operating system is directly invoked to obtain the identity identification information of the application, so that the malicious application cannot forge the identity identification information.
  • the security of the security platform can be further improved.
  • the attacker since the C-language library interface or the C++ language library interface is used to realize the acquisition of the identification information of the object required for the signature processing, the attacker wants to completely solve the problem. It can further improve the security of the call of the security platform.
  • the current network timestamp is further used as the verification parameter, in addition to the first signature information and the application identification information of the application. Sending to the open platform to jointly participate in the verification operation of the first signature information by the open platform, so that the attacker cannot pass the verification by replaying the verification parameters, and can avoid the security problem caused by the attacker using the playback verification parameter, and can further Improve the security of calls to the security platform.
  • FIG. 1 is a schematic flowchart of a method for calling an open platform according to an embodiment of the present invention
  • FIG. 2 is a schematic flowchart of a method for calling an open platform according to another embodiment of the present invention.
  • FIG. 3 is a schematic structural diagram of an apparatus for calling an open platform according to another embodiment of the present invention.
  • the terminals involved in the embodiments of the present invention may include, but are not limited to, a mobile phone, a personal digital assistant (PDA), a wireless handheld device, a wireless netbook, a personal computer, a portable computer, a tablet computer, and an MP3 player.
  • PDA personal digital assistant
  • Device, MP4 broadcast A device, a wearable device (for example, smart glasses, a smart watch, a smart bracelet, etc.).
  • FIG. 1 is a schematic flowchart of a method for calling an open platform according to an embodiment of the present invention, as shown in FIG. 1 .
  • the application refers to an application running on the terminal that loads the operating system, and may be an Android (Android) application, or may also be an IOS application. This embodiment does not specifically limit this.
  • the Android app is an application that runs on a terminal that loads an Android operating system.
  • the IOS application is an application running on a terminal loaded with an IOS operating system.
  • the access token sent by the open platform is used to invoke an open API provided by the open platform, where the access token uses the second signature information for the open platform, and performs the first signature information.
  • the second signature information is obtained by the open platform signing the identity information registered by the application, and the identity information of the application registration is the open platform according to the application identifier. Information obtained.
  • the access token can be a unique string that identifies the application. Once After the authentication is passed, the application needs to carry the access token to indicate its identity during the subsequent communication with the open platform.
  • the execution entities of 101 to 104 may be applications located in the local terminal, or may be plug-ins or software development kits (SDKs) in the application of the local terminal, and these functional units.
  • the library may be composed of a series of programming language code and a programming language code (for example, a LIB library, etc.), which is not specifically limited in this embodiment.
  • the application may be an application (nativeApp) installed on the terminal, or may be a web application (webApp) of the browser on the terminal, which is not limited in this embodiment.
  • the identity identification information is subjected to signature processing to obtain the first signature information of the application, and the first signature information and the application identifier of the application are sent to the open platform.
  • the information enables the access token sent by the open platform to be used to invoke the open API provided by the open platform. Since the authentication parameters of the plaintext are not transmitted, the security of the secure platform call is improved.
  • the application may specifically interact with the open platform to perform a registration operation.
  • the application may specifically send the identity information of the application to the open platform.
  • the application obtains an application identification information, such as an application ID, assigned by the open platform for the application, to uniquely identify the application on the open platform.
  • the identity identification information may include, but is not limited to, at least one of a package name and a package signature.
  • the package name of the Android app refers to the installation package of the Android app (Android Package Kit, APK)
  • the name of the file refers to the signature information of the Android application package (Android Package Kit, APK) file.
  • an APK file is an application installation file format on an Android operating system, and its English name is "Application Package File”.
  • An Android application code that wants to run on a device loaded with an Android operating system must be compiled first and then packaged into a file that can be recognized by the Android operating system before it can be run. This can be recognized by the Android operating system.
  • the file format that is run is ".APK”.
  • An APK file contains a manifest file (AndroidManifest.xml), a META-INFO folder, a compiled code file (classes.dex), a res folder, and a resource file (resources.arsc).
  • the APK file is actually a ZIP archive.
  • the name of the APK file can be stored in AndroidManifest.xml.
  • the signature information of the APK file can be stored in the META-INF directory, ie, the META-INF folder.
  • an interface provided by the application may be specifically invoked to obtain the identity identification information.
  • the Java language library interface of the application may be specifically invoked; using a Java Native Interface (JNI) technology, the C language library interface or the C++ language library interface of the application is invoked to invoke the operating system.
  • JNI Java Native Interface
  • An interface is provided to obtain the identity information.
  • the interface provided by the operating system is directly invoked to obtain the identity information of the application, so that the malicious application cannot forge the identity information, thereby avoiding the forgery of the identity due to the malicious application.
  • Security issues caused by information can further improve the security of calls made by the security platform.
  • the C-language library interface or the C++ language library interface is used to realize the acquisition of the identity information of the object required for the signature processing, the attacker wants to completely crack, and the call of the security platform can be further improved. safety.
  • any signature algorithm in the prior art may be used to perform signature processing on the identity identification information.
  • the identity identification information may be signed and processed by using an algorithm such as a Message-Digest Algorithm 5 (MD5) or a Secure Hash Algorithm (SHA).
  • MD5 Message-Digest Algorithm 5
  • SHA Secure Hash Algorithm
  • the open platform may obtain the identity identification information registered by the application according to the application identification information, and then perform signature processing on the identity identification information registered by the application. Obtain the second signature information. Then, the open platform may use the second signature information to verify the first signature information. If the first signature information is consistent with the second signature information, the verification is successful; if the first signature information is inconsistent with the second signature information, the verification fails.
  • the current network timestamp may be further acquired.
  • the reason for obtaining the current network timestamp is that many users will modify the system timestamp on the terminal.
  • the system timestamp is generally inconsistent with the real network timestamp, and even the difference will be large. Therefore, the system on the terminal The timestamp does not accurately reflect the current time information, only the network timestamp can accurately reflect the current time information.
  • the step of acquiring the identity information of the application and the step of acquiring the current network timestamp are performed in a non-fixed execution sequence, and the step of acquiring the identity information of the application may be performed first, and then the current network time is obtained.
  • Step of stamping, or performing the step of acquiring the identifier information of the application, performing the step of acquiring the current network timestamp, or performing the step of acquiring the current network timestamp, and then performing the obtaining the identity of the application The steps of the information are not particularly limited in this embodiment.
  • the identity identification information and the network timestamp may be specifically processed to obtain the first signature information.
  • the application identifier information, the network timestamp, and the first signature information of the application may be sent to the open platform, where the open platform is configured according to the network timestamp and the application identifier. And obtaining the identity information of the application registration, and performing signature processing on the identity information registered by the application and the network timestamp to obtain the second signature information.
  • the open platform after receiving the application identification information, the network timestamp, and the first signature information of the application, the open platform first determines according to the network timestamp and the current system timestamp to determine the currently received Whether the verification parameters (ie, the application identification information of the application, the network timestamp, and the first signature information) are attackers' replay attacks.
  • the verification parameters ie, the application identification information of the application, the network timestamp, and the first signature information
  • a normal message may continue to perform subsequent operations, that is, performing identification information of the application registration according to the application identification information; if the difference between the network timestamp and the current system timestamp is greater than the time threshold. Then, it can be determined that the currently received verification parameters are an attacker's replay attack, which is an abnormal message, and no longer performs subsequent operations, that is, no longer performs according to the application identification information.
  • the identity information of the application registration may further directly return an error code.
  • the reason for using the current system timestamp is that most open platforms can guarantee that the system timestamp on it is consistent with the real network timestamp. Therefore, the open platform's system timestamp can accurately reflect the current Time information, no need to get the network timestamp.
  • Replay Attacks also known as replay attacks, replay attacks, or freshness attacks, means that an attacker sends a packet that the destination host has received to achieve the purpose of spoofing the system, mainly for the identity authentication process. , destroy the correctness of the certification. It is a type of attack that repeatedly and maliciously or fraudulently repeats an effective data transmission.
  • the replay attack can be performed by the initiator or by an enemy that intercepts and resends the data.
  • the attacker uses network monitoring or other means to steal authentication credentials, such as authentication parameters and the like in the present invention, and then re-sends it to the authentication server, for example, the open platform or the like in the present invention.
  • signature processing can effectively prevent session hijacking, but it does not prevent replay attacks. Replay attacks can occur during any network communication.
  • the current network timestamp is further used as a verification parameter, and is sent to the open platform to jointly participate in the verification operation of the first signature information by the open platform, so that the attack is performed.
  • the verification cannot be performed by replaying the verification parameters, and the security problem caused by the attacker using the replay verification parameters can be avoided, and the security of the security platform call can be further improved.
  • the technical solution provided by the present invention will be described in detail below by taking the Android application A of the local terminal and the SDK located in the Android application A as an example.
  • the SDK provided in this embodiment may be a LIB library specifically implemented by a series of Java language code and C language/C++ language code.
  • the C language/C++ language library interface is stored in the LIB library implemented by the C language/C++ language code. as shown in picture 2.
  • the Android application A sends the package name and the package signature of the Android application A to the open platform to perform the registration operation.
  • the open platform allocates an application ID to the Android application A.
  • the open platform sends the allocated application ID to the Android application A.
  • the Android application A obtains the current network timestamp.
  • the Android application A invokes a Java language library interface provided by the SDK for acquiring signature information, and transmits the network timestamp to the C language/C++ language library interface to invoke an interface provided by the operating system to obtain the Android application.
  • the package name and the package signature of the Android application A and the network time stamp may be signed and processed by using a preset signature key to obtain an Android application.
  • the first signature information of A may be signed and processed by using a preset signature key to obtain an Android application.
  • the Android application A sends an application ID of the Android application A, the first signature information, and the network timestamp to the open platform.
  • the open platform determines, according to the network timestamp and the current system timestamp, to determine a currently received verification parameter (ie, an application ID of the Android application A, the first signature information, and the network timestamp). Whether it is an attacker's replay attack, if it is not the attacker's replay attack, execute 208, otherwise, the process ends.
  • a currently received verification parameter ie, an application ID of the Android application A, the first signature information, and the network timestamp.
  • the open platform obtains the package name and the package signature of the Android application A registered by the Android application A according to the application ID of the Android application A, and uses a preset signature key (consistent with the signature key used when obtaining the first signature information) And signing the package name and the package signature of the Android application A and the network time stamp to obtain the second signature information of the Android application A.
  • the open platform uses the second signature information to verify the first signature information. If the verification succeeds, execute 210. Otherwise, the process ends.
  • the verification fails if the first signature information is consistent with the second signature information. Specifically, if the first signature information is consistent with the second signature information, the verification is successful; if the first signature information is inconsistent with the second signature information, the verification fails.
  • the open platform generates an access token according to an application ID of the Android application A and other related information of the Android application A.
  • the open platform sends the access token to the Android application A.
  • Android Application A obtains the access token provided by the open platform.
  • Android Application A calls the open API provided by the open platform, it needs to carry the access token for the open platform to be based on the access token. Provide appropriate access to Android App A.
  • the identity identification information is further subjected to signature processing to obtain first signature information of the application, and the first signature information and the application are sent to the open platform.
  • the application identification information enables the access token sent by the open platform to be used to invoke the open API provided by the open platform. Since the authentication parameters of the plaintext are not transmitted, the security of the security platform call is improved.
  • the security problem caused by the leakage of the verification parameter can be avoided, and the security of the call of the security platform can be further improved.
  • the server corresponding to the application and the application does not need to store the key information, and can avoid the security problem caused by the leakage of the verification parameter, and can Further improve the security of the call of the security platform.
  • the interface provided by the operating system is directly invoked to obtain the identity identification information of the application, so that the malicious application cannot forge the identity identification information.
  • the security of the security platform can be further improved.
  • the attacker since the C-language library interface or the C++ language library interface is used to realize the acquisition of the identification information of the object required for the signature processing, the attacker wants to completely solve the problem. It can further improve the security of the call of the security platform.
  • the current network timestamp is further used as a verification parameter, and is sent to the open platform to jointly participate in the open platform.
  • the verification operation of the signature information makes it impossible for an attacker to pass the verification by playing back the verification parameter, and the security problem caused by the attacker using the playback verification parameter can be avoided, and the security of the call of the security platform can be further improved.
  • FIG. 3 is a schematic structural diagram of an apparatus for calling an open platform according to another embodiment of the present invention, as shown in FIG. 3.
  • the calling device of the open platform of this embodiment may include an obtaining unit 31, a signing unit 32, a transmitting unit 33, and a receiving unit 34.
  • the obtaining unit 31 is configured to acquire the identity identification information of the application
  • the signature unit 32 is configured to perform signature processing on the identity identification information to obtain first signature information of the application
  • a sending unit 33 is configured to be open to the public.
  • the platform sends the first signature information and the application identifier information of the application;
  • the receiving unit 34 is configured to receive an access token sent by the open platform, to invoke an open API provided by the open platform, where the access
  • the token is obtained by using the second signature information by the open platform, and after the verification of the first signature information is successful, the second signature information is that the open platform performs signature processing on the identity identification information registered by the application.
  • the obtained identity information of the application registration is obtained by the open platform according to the application identification information.
  • the calling device of the open platform may be an application located in a local terminal, or may be a plug-in or a software development kit (SDK) in an application of the local terminal.
  • SDK software development kit
  • the unit which may be composed of a series of programming language code and a library (for example, a LIB library, etc.), is not limited in this embodiment.
  • the application may be an application (nativeApp) installed on the terminal, or may be a web application (webApp) of the browser on the terminal, which is not limited in this embodiment.
  • the identifier information may include, but is not limited to, at least one of a package name and a package signature, which is not specifically limited in this embodiment.
  • the acquiring unit 31 Specifically, the interface provided by the application may be invoked to obtain the identity identification information.
  • the obtaining unit 31 may be specifically configured to invoke a Java language library interface of the application; using a JNI technology, calling a C language library interface or a C++ language library interface of the application to invoke the operating system to provide Interface to obtain the identity information.
  • the acquiring unit 31 may be further configured to obtain a current network timestamp.
  • the signing unit 32 may be specifically configured to perform signature processing on the identity identification information and the network timestamp to obtain the first signature information
  • the sending unit 33 may be specifically used in
  • the open platform sends the application identifier information of the application, the network timestamp, and the first signature information
  • the second signature information is specifically the identity identifier information that the open platform registers with the application
  • the network The time stamp is obtained by the signature processing, and the identifier information of the application registration is obtained by the open platform according to the network time stamp and the application identifier information.
  • the acquiring unit obtains the identity identification information of the application, and then the signature unit performs signature processing on the identity identification information to obtain the first signature information of the application, and the sending unit sends the identifier to the open platform.
  • the first signature information and the application identification information of the application so that the receiving unit can receive the access token sent by the open platform, and invoke the open API provided by the open platform, because the authentication parameter of the plaintext is not transmitted, thereby Improve the security of calls to the security platform.
  • the server corresponding to the application and the application does not need to store the key information, and the security problem caused by the leakage of the verification parameter can be avoided, and the security of the call of the security platform can be further improved.
  • the interface provided by the operating system is directly invoked to obtain the identity identification information of the application, so that the malicious application cannot forge the identity identification information.
  • the security of the security platform can be further improved.
  • the attacker since the C-language library interface or the C++ language library interface is used to realize the acquisition of the identification information of the object required for the signature processing, the attacker wants to completely solve the problem. It can further improve the security of the call of the security platform.
  • the current network timestamp is further used as a verification parameter, and is sent to the open platform to jointly participate in the open platform.
  • the verification operation of the signature information makes it impossible for an attacker to pass the verification by playing back the verification parameter, and the security problem caused by the attacker using the playback verification parameter can be avoided, and the security of the call of the security platform can be further improved.
  • the disclosed system, apparatus, and method may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of the unit is only a logical function division.
  • there may be another division manner for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of hardware plus software functional units.
  • the above-described integrated unit implemented in the form of a software functional unit can be stored in a computer readable storage medium.
  • the above software functional unit is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor to perform the methods of the various embodiments of the present invention. Part of the steps.
  • the foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like, which can store program codes. .

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • Telephonic Communication Services (AREA)

Abstract

本发明提供一种开放平台的调用方法、装置、设备及非易失性计算机存储介质。本发明实施例通过获取应用的身份标识信息,进而对所述身份标识信息进行签名处理,以获得所述应用的第一签名信息,并向开放平台发送所述第一签名信息和所述应用的应用标识信息,使得能够接收所述开放平台发送的访问令牌,用以调用所述开放平台所提供的开放API,由于没有传输明文的验证参数,从而提高了安全平台的调用的安全性。

Description

开放平台的调用方法、装置、设备及非易失性计算机存储介质
本申请要求了申请日为2014年08月27日,申请号为201410427923.5发明名称为“开放平台的调用方法及装置”的中国专利申请的优先权。
技术领域
本发明涉及授权技术,特别涉及一种开放平台的调用方法、装置、设备及非易失性计算机存储介质。
背景技术
在互联网时代,把网站的服务封装成一系列机器易识别的数据接口开放出去,供第三方开发者使用,这种行为就叫做开放(Open)应用程序编程接口(Application Programming Interface,API),提供开放API的平台本身就被称为开放平台(Open Platform)。目前,大部分开放平台所提供的开放API,在被第三方应用调用时,都需要第三方应用通过开放平台所提供的授权机制获取一个访问令牌,又可以称为访问授权码。在第三方应用每次调用开放API时,都需要携带这个访问令牌,以供开放平台能够根据该访问令牌,向第三方应用提供相应的访问权限。
现有技术中,应用可以利用应用开放平台为应用分配的应用标识信息和密钥信息,向开放平台请求获取访问令牌,安全性不高。
发明内容
本发明的多个方面提供一种开放平台的调用方法、装置、设备及非易失性计算机存储介质,用以提高安全平台的调用的安全性。
本发明的一方面,提供一种开放平台的调用方法,包括:
获取应用的身份标识信息;
对所述身份标识信息进行签名处理,以获得所述应用的第一签名信息;
向开放平台发送所述第一签名信息和所述应用的应用标识信息;
接收所述开放平台发送的访问令牌,用以调用所述开放平台所提供的开放API,所述访问令牌为所述开放平台利用第二签名信息,对所述第一签名信息进行验证成功之后获得的,所述第二签名信息为所述开放平台对所述应用注册的身份标识信息进行签名处理获得的,所述应用注册的身份标识信息为所述开放平台根据所述应用标识信息获得的。
如上所述的方面和任一可能的实现方式,进一步提供一种实现方式,所述获取应用的身份标识信息,包括:
调用所述应用所提供的接口,以获得所述身份标识信息。
如上所述的方面和任一可能的实现方式,进一步提供一种实现方式,所述调用所述应用所提供的接口,以获得所述身份标识信息,包括:
调用所述应用的Java语言库接口;采用JNI技术,调用所述应用的C语言库接口或C++语言库接口,以调用所述操作系统所提供的接口,以获得所述身份标识信息。
如上所述的方面和任一可能的实现方式,进一步提供一种实现方式,所述身份标识信息包括包名和包签名中的至少一项。
如上所述的方面和任一可能的实现方式,进一步提供一种实现方式,所述对所述身份标识信息进行签名处理,以获得所述应用的第一签名信息之前,还包括:
获取当前的网络时间戳;
所述对所述身份标识信息进行签名处理,以获得所述应用的第一签名信息,包括:
对所述身份标识信息和所述网络时间戳进行签名处理,以获得所述第一签名信息;
所述向开放平台发送所述第一签名信息和所述应用的应用标识信息,包括:
向所述开放平台发送所述应用的应用标识信息、所述网络时间戳和所述第一签名信息;
所述第二签名信息具体为所述开放平台对所述应用注册的身份标识信息和所述网络时间戳进行签名处理获得的,所述应用注册的身份标识信息为所述开放平台根据所述网络时间戳和所述应用标识信息获得的。
本发明的另一方面,提供一种开放平台的调用装置,包括:
获取单元,用于获取应用的身份标识信息;
签名单元,用于对所述身份标识信息进行签名处理,以获得所述应 用的第一签名信息;
发送单元,用于向开放平台发送所述第一签名信息和所述应用的应用标识信息;
接收单元,用于接收所述开放平台发送的访问令牌,用以调用所述开放平台所提供的开放API,所述访问令牌为所述开放平台利用第二签名信息,对所述第一签名信息进行验证成功之后获得的,所述第二签名信息为所述开放平台对所述应用注册的身份标识信息进行签名处理获得的,所述应用注册的身份标识信息为所述开放平台根据所述应用标识信息获得的。
如上所述的方面和任一可能的实现方式,进一步提供一种实现方式,所述获取单元,具体用于
调用所述应用所提供的接口,以获得所述身份标识信息。
如上所述的方面和任一可能的实现方式,进一步提供一种实现方式,所述获取单元,具体用于
调用所述应用的Java语言库接口;采用JNI技术,调用所述应用的C语言库接口或C++语言库接口,以调用所述操作系统所提供的接口,以获得所述身份标识信息。
如上所述的方面和任一可能的实现方式,进一步提供一种实现方式,所述身份标识信息包括包名和包签名中的至少一项。
如上所述的方面和任一可能的实现方式,进一步提供一种实现方式,
所述获取单元,还用于
获取当前的网络时间戳;
所述签名单元,具体用于
对所述身份标识信息和所述网络时间戳进行签名处理,以获得所述第一签名信息;
所述发送单元,具体用于
向所述开放平台发送所述应用的应用标识信息、所述网络时间戳和所述第一签名信息;
所述第二签名信息具体为所述开放平台对所述应用注册的身份标识信息和所述网络时间戳进行签名处理获得的,所述应用注册的身份标识信息为所述开放平台根据所述网络时间戳和所述应用标识信息获得的。
本发明的另一方面,提供一种设备,包括:
一个或者多个处理器;
存储器;
一个或者多个程序,所述一个或者多个程序存储在所述存储器中,当被所述一个或者多个处理器执行时:
获取应用的身份标识信息;
对所述身份标识信息进行签名处理,以获得所述应用的第一签名信息;
向开放平台发送所述第一签名信息和所述应用的应用标识信息;
接收所述开放平台发送的访问令牌,用以调用所述开放平台所提供 的开放API,所述访问令牌为所述开放平台利用第二签名信息,对所述第一签名信息进行验证成功之后获得的,所述第二签名信息为所述开放平台对所述应用注册的身份标识信息进行签名处理获得的,所述应用注册的身份标识信息为所述开放平台根据所述应用标识信息获得的。
本发明的另一方面,提供一种非易失性计算机存储介质,所述非易失性计算机存储介质存储有一个或者多个程序,当所述一个或者多个程序被一个设备执行时,使得所述设备:
获取应用的身份标识信息;
对所述身份标识信息进行签名处理,以获得所述应用的第一签名信息;
向开放平台发送所述第一签名信息和所述应用的应用标识信息;
接收所述开放平台发送的访问令牌,用以调用所述开放平台所提供的开放API,所述访问令牌为所述开放平台利用第二签名信息,对所述第一签名信息进行验证成功之后获得的,所述第二签名信息为所述开放平台对所述应用注册的身份标识信息进行签名处理获得的,所述应用注册的身份标识信息为所述开放平台根据所述应用标识信息获得的。
由上述技术方案可知,本发明实施例通过获取应用的身份标识信息,进而对所述身份标识信息进行签名处理,以获得所述应用的第一签名信息,并向开放平台发送所述第一签名信息和所述应用的应用标识信息,使得能够接收所述开放平台发送的访问令牌,用以调用所述开放平台所提供的开放API,由于没有传输明文的验证参数,从而提高了安全平台 的调用的安全性。
另外,采用本发明提供的技术方案,由于没有传输明文的密钥信息,能够避免由于验证参数泄露而导致的安全问题,能够进一步提高安全平台的调用的安全性。
另外,采用本发明提供的技术方案,应用和应用所对应的服务器无需存储密钥信息,能够避免由于验证参数泄露而导致的安全问题,能够进一步提高安全平台的调用的安全性。
另外,采用本发明提供的技术方案,通过利用C语言库接口或C++语言库接口,直接调用操作系统所提供的接口,来获得应用的身份标识信息,使得恶意的应用无法伪造身份标识信息,能够避免由于恶意的应用伪造身份标识信息而导致的安全问题,能够进一步提高安全平台的调用的安全性。
另外,采用本发明提供的技术方案,由于利用C语言库接口或C++语言库接口,实现签名处理所需要的对象即应用的身份标识信息,的获取,攻击者想要完全破解的难度相当大,能够进一步提高安全平台的调用的安全性。
另外,采用本发明提供的技术方案,由于除了第一签名信息和应用的应用标识信息之外,还进一步将当前的网络时间戳作为验证参数,发 送给开放平台,以共同参与开放平台对第一签名信息的验证操作,使得攻击者无法通过重放验证参数来通过验证,能够避免由于攻击者利用重放验证参数而导致的安全问题,能够进一步提高安全平台的调用的安全性。
附图说明
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1为本发明一实施例提供的开放平台的调用方法的流程示意图;
图2为本发明另一实施例提供的开放平台的调用方法的流程示意图;
图3为本发明另一实施例提供的开放平台的调用装置的结构示意图。
具体实施方式
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的全部其他实施例,都属于本发明保护的范围。
需要说明的是,本发明实施例中所涉及的终端可以包括但不限于手机、个人数字助理(Personal Digital Assistant,PDA)、无线手持装置、无线上网本、个人电脑、便携电脑、平板电脑、MP3播放器、MP4播 放器、可穿戴设备(例如,智能眼镜、智能手表、智能手环等)等。
另外,本文中术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中字符“/”,一般表示前后关联对象是一种“或”的关系。
图1为本发明一实施例提供的开放平台的调用方法的流程示意图,如图1所示。
101、获取应用的身份标识信息。
其中,应用,即第三方应用,是指运行在装载操作系统的终端上的应用程序,可以为安卓(Android)应用,或者还可以为IOS应用,本实施例对此不进行特别限定。安卓(Android)应用,是运行在装载安卓操作系统的终端上的应用程序。IOS应用,是运行在装载IOS操作系统的终端上的应用程序。
102、对所述身份标识信息进行签名处理,以获得所述应用的第一签名信息。
103、向开放平台发送所述第一签名信息和所述应用的应用标识信息。
104、接收所述开放平台发送的访问令牌,用以调用所述开放平台所提供的开放API,所述访问令牌为所述开放平台利用第二签名信息,对所述第一签名信息进行验证成功之后获得的,所述第二签名信息为所述开放平台对所述应用注册的身份标识信息进行签名处理获得的,所述应用注册的身份标识信息为所述开放平台根据所述应用标识信息获得的。
访问令牌(token)可以为一个唯一的字符串,用于标识应用。一旦 身份验证通过之后,应用在后续与开放平台的通信过程中,需要携带这个访问令牌,用于表明其身份。
需要说明的是,101~104的执行主体可以为位于本地终端的应用,或者还可以为位于本地终端的应用中的插件或软件开发工具包(Software Development Kit,SDK)等功能单元,这些功能单元具体可以由一系列编程语言代码和编程语言代码所实现的库(例如,LIB库等)组成,本实施例对此不进行特别限定。
可以理解的是,所述应用可以是安装在终端上的应用程序(nativeApp),或者还可以是终端上的浏览器的一个网页程序(webApp),本实施例对此不进行限定。
这样,通过获取应用的身份标识信息,进而对所述身份标识信息进行签名处理,以获得所述应用的第一签名信息,并向开放平台发送所述第一签名信息和所述应用的应用标识信息,使得能够接收所述开放平台发送的访问令牌,用以调用所述开放平台所提供的开放API,由于没有传输明文的验证参数,从而提高了安全平台的调用的安全性。
可选地,在本实施例的一个可能的实现方式中,在101之前,应用具体可以与开放平台进行交互,以执行注册操作。在执行注册操作的过程中,应用具体可以向开放平台发送应用的身份标识信息。完成注册操作之后,应用获得一个由开放平台为应用分配的应用标识信息例如,应用ID等,用以在开放平台上唯一标识该应用。
其中,所述身份标识信息可以包括但不限于包名和包签名中的至少一项。
例如,安卓应用的包(package)名,是指安卓应用的安装包(Android  Package Kit,APK)文件的名称。安卓应用的包签名,是指安卓应用的安装包(Android Package Kit,APK)文件的签名信息。
一般来说,APK文件,是一种安卓操作系统上的应用安装文件格式,其英文全称为“Application Package File”。一个安卓应用的代码想要在装载安卓操作系统的设备上运行,必须先进行编译,然后被打包成为一个被安卓操作系统所能识别的文件才可以被运行,而这种能被安卓操作系统识别并运行的文件格式便是“.APK”。一个APK文件内包含清单文件(AndroidManifest.xml)、META-INFO文件夹、被编译的代码文件(classes.dex)、res文件夹和资源文件(resources.arsc)。其中,APK文件的详细描述可以参见现有技术中的相关内容,此处不再赘述。APK文件实际上是一个ZIP压缩包。其中,APK文件的名称,可以存储在AndroidManifest.xml中。APK文件的签名信息,可以存储在META-INF目录即META-INF文件夹下。
可选地,在本实施例的一个可能的实现方式中,在101中,具体可以调用所述应用所提供的接口,以获得所述身份标识信息。
具体地,具体可以调用所述应用的Java语言库接口;采用Java本地调用(Java Native Interface,JNI)技术,调用所述应用的C语言库接口或C++语言库接口,以调用所述操作系统所提供的接口,以获得所述身份标识信息。
这样,通过利用C语言库接口或C++语言库接口,直接调用操作系统所提供的接口,来获得应用的身份标识信息,使得恶意的应用无法伪造身份标识信息,能够避免由于恶意的应用伪造身份标识信息而导致的安全问题,能够进一步提高安全平台的调用的安全性。
此外,由于利用C语言库接口或C++语言库接口,实现签名处理所需要的对象即应用的身份标识信息,的获取,攻击者想要完全破解的难度相当大,能够进一步提高安全平台的调用的安全性。
可选地,在本实施例的一个可能的实现方式中,在102中,具体可以采用现有技术中的任何签名算法,对所述身份标识信息进行签名处理。例如,可以采用信息摘要算法5(Message-Digest Algorithm 5,MD5)或安全散列算法(Secure Hash Algorithm,SHA)等算法,对所述身份标识信息进行签名处理,本实施例对此不进行特别限定。
本实施例中,开放平台接收到所述应用标识信息之后,则可以根据所述应用标识信息,获得所述应用注册的身份标识信息,进而对所述应用注册的身份标识信息进行签名处理,以获得第二签名信息。然后,所述开放平台则可以利用所述第二签名信息,对所述第一签名信息进行验证。若所述第一签名信息与所述第二签名信息一致,则说明验证成功;若所述第一签名信息与所述第二签名信息不一致,则说明验证失败。
可以理解的是,开放平台对所述应用注册的身份标识信息进行的签名处理,应该与102中所执行的签名处理是一致的,其所使用的密钥信息也应该是一致。
可选地,在本实施例的一个可能的实现方式中,在102之前,还可以进一步获取当前的网络时间戳。
之所以获取当前的网络时间戳,原因在于,很多用户都会修改终端上的系统时间戳,系统时间戳与真正的网络时间戳一般都是不一致的,甚至相差会很大,因此,终端上的系统时间戳并不能准确地反映当前的时间信息,只有网络时间戳才能准确地反映当前的时间信息。
需要说明的是,执行获取应用的身份标识信息的步骤与执行获取当前的网络时间戳的步骤,没有固定的执行顺序,可以先执行获取应用的身份标识信息的步骤,再执行获取当前的网络时间戳的步骤,或者还可以执行获取应用的身份标识信息的步骤的同时,执行获取当前的网络时间戳的步骤,或者还可以先执行获取当前的网络时间戳的步骤,再执行获取应用的身份标识信息的步骤,本实施例对此不进行特别限定。
相应地,在102中,具体可以对所述身份标识信息和所述网络时间戳进行签名处理,以获得所述第一签名信息。在103中,则可以向所述开放平台发送所述应用的应用标识信息、所述网络时间戳和所述第一签名信息,以供所述开放平台根据所述网络时间戳和所述应用标识信息,获得所述应用注册的身份标识信息,对所述应用注册的身份标识信息和所述网络时间戳进行签名处理,以获得所述第二签名信息。
具体地,开放平台接收到所述应用的应用标识信息、所述网络时间戳和所述第一签名信息之后,首先根据所述网络时间戳和当前的系统时间戳进行判断,以确定当前所接收到的这些验证参数(即所述应用的应用标识信息、所述网络时间戳和所述第一签名信息)是否为攻击者的重放攻击。若所述网络时间戳与当前的系统时间戳之间的差值小于或等于预先设置的时间阈值例如,5分钟,则可以确定当前所接收到的这些验证参数不是攻击者的重放攻击,是一个正常的消息,可以继续执行后续操作即执行根据所述应用标识信息,获得所述应用注册的身份标识信息;若所述网络时间戳与当前的系统时间戳之间的差值大于该时间阈值,则可以确定当前所接收到的这些验证参数是攻击者的重放攻击,是一个异常的消息,不再执行后续操作即不再执行根据所述应用标识信息,获得 所述应用注册的身份标识信息,进一步还可以直接返回错误代码。
之所以利用当前的系统时间戳,原因在于,大部分开放平台都能够保证其上的系统时间戳与真正的网络时间戳是一致的,因此,开放平台的系统时间戳已经能够准确地反映当前的时间信息,无需再去获取网络时间戳。
重放攻击(Replay Attacks)又称重播攻击、回放攻击或新鲜性攻击(Freshness Attacks),是指攻击者发送一个目的主机已接收过的包,来达到欺骗系统的目的,主要用于身份认证过程,破坏认证的正确性。它是一种攻击类型,这种攻击会不断恶意或欺诈性地重复一个有效的数据传输,重放攻击可以由发起者,也可以由拦截并重发该数据的敌方进行。攻击者利用网络监听或者其他方式盗取认证凭据例如,本发明中的验证参数等,之后再把它重新发给认证服务器例如,本发明中的开放平台等。
从这个解释上理解,签名处理可以有效防止会话劫持,但是却防止不了重放攻击。重放攻击任何网络通信过程中都可能发生。
这样,由于除了第一签名信息和应用的应用标识信息之外,还进一步将当前的网络时间戳作为验证参数,发送给开放平台,以共同参与开放平台对第一签名信息的验证操作,使得攻击者无法通过重放验证参数来通过验证,能够避免由于攻击者利用重放验证参数而导致的安全问题,能够进一步提高安全平台的调用的安全性。
下面将以本地终端的安卓应用A,以及位于安卓应用A中的SDK为例,详细说明本发明所提供的技术方案。本实施例所提供的SDK,具体可以由一系列Java语言代码和C语言/C++语言代码所实现的LIB库 组成,该C语言/C++语言代码所实现的LIB库中存储C语言/C++语言库接口。如图2所示。
201、安卓应用A向开放平台发送安卓应用A的包名和包签名,以执行注册操作。
202、开放平台为安卓应用A分配应用ID。
203、开放平台向安卓应用A发送所分配的应用ID。
204、安卓应用A获取当前的网络时间戳。
205、安卓应用A调用SDK提供的用于获取签名信息的Java语言库接口,将所述网络时间戳传入C语言/C++语言库接口,以调用操作系统所提供的接口,以获得该安卓应用A的包名和包签名。
SDK提供的用于获取签名信息的Java语言库接口被调用之后,可以利用预先设置的签名密钥,对安卓应用A的包名和包签名、以及所述网络时间戳进行签名处理,以获得安卓应用A的第一签名信息。
206、安卓应用A向开放平台发送安卓应用A的应用ID、所述第一签名信息和所述网络时间戳。
207、开放平台根据所述网络时间戳和当前的系统时间戳进行判断,以确定当前所接收到的验证参数(即安卓应用A的应用ID、所述第一签名信息和所述网络时间戳)是否为攻击者的重放攻击,若不是攻击者的重放攻击,则执行208,否则,结束流程。
208、开放平台根据安卓应用A的应用ID,获得安卓应用A注册的安卓应用A的包名和包签名,利用预先设置的签名密钥(与获得第一签名信息时所使用的签名密钥一致),对安卓应用A的包名和包签名、以及所述网络时间戳进行签名处理,以获得安卓应用A的第二签名信息。
209、开放平台利用所述第二签名信息,对所述第一签名信息进行验证,若验证成功,则执行210,否则,结束流程。
具体地,若所述第一签名信息与所述第二签名信息一致,则说明验证成功;若所述第一签名信息与所述第二签名信息不一致,则说明验证失败
210、开放平台根据安卓应用A的应用ID,以及安卓应用A的其他相关信息,生成访问令牌。
生成访问令牌的详细描述具体可以参见现有技术中的相关内容,此处不再赘述。
211、开放平台向安卓应用A发送所述访问令牌。
至此,安卓应用A获得开放平台所提供的访问令牌,在安卓应用A每次调用开放平台所提供的开放API时,都需要携带这个访问令牌,以供开放平台能够根据该访问令牌,向安卓应用A提供相应的访问权限。
本实施例中,通过获取应用的身份标识信息,进而对所述身份标识信息进行签名处理,以获得所述应用的第一签名信息,并向开放平台发送所述第一签名信息和所述应用的应用标识信息,使得能够接收所述开放平台发送的访问令牌,用以调用所述开放平台所提供的开放API,由于没有传输明文的验证参数,从而提高了安全平台的调用的安全性。
另外,采用本发明提供的技术方案,由于没有传输明文的密钥信息,能够避免由于验证参数泄露而导致的安全问题,能够进一步提高安全平台的调用的安全性。
另外,采用本发明提供的技术方案,应用和应用所对应的服务器无需存储密钥信息,能够避免由于验证参数泄露而导致的安全问题,能够 进一步提高安全平台的调用的安全性。
另外,采用本发明提供的技术方案,通过利用C语言库接口或C++语言库接口,直接调用操作系统所提供的接口,来获得应用的身份标识信息,使得恶意的应用无法伪造身份标识信息,能够避免由于恶意的应用伪造身份标识信息而导致的安全问题,能够进一步提高安全平台的调用的安全性。
另外,采用本发明提供的技术方案,由于利用C语言库接口或C++语言库接口,实现签名处理所需要的对象即应用的身份标识信息,的获取,攻击者想要完全破解的难度相当大,能够进一步提高安全平台的调用的安全性。
另外,采用本发明提供的技术方案,由于除了第一签名信息和应用的应用标识信息之外,还进一步将当前的网络时间戳作为验证参数,发送给开放平台,以共同参与开放平台对第一签名信息的验证操作,使得攻击者无法通过重放验证参数来通过验证,能够避免由于攻击者利用重放验证参数而导致的安全问题,能够进一步提高安全平台的调用的安全性。
需要说明的是,对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本发明并不受所描述的动作顺序的限制,因为依据本发明,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定是本发明所必须的。
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中 没有详述的部分,可以参见其他实施例的相关描述。
图3为本发明另一实施例提供的开放平台的调用装置的结构示意图,如图3所示。本实施例的开放平台的调用装置可以包括获取单元31、签名单元32、发送单元33和接收单元34。其中,获取单元31,用于获取应用的身份标识信息;签名单元32,用于对所述身份标识信息进行签名处理,以获得所述应用的第一签名信息;发送单元33,用于向开放平台发送所述第一签名信息和所述应用的应用标识信息;接收单元34,用于接收所述开放平台发送的访问令牌,用以调用所述开放平台所提供的开放API,所述访问令牌为所述开放平台利用第二签名信息,对所述第一签名信息进行验证成功之后获得的,所述第二签名信息为所述开放平台对所述应用注册的身份标识信息进行签名处理获得的,所述应用注册的身份标识信息为所述开放平台根据所述应用标识信息获得的。
需要说明的是,本实施例所提供的开放平台的调用装置可以为位于本地终端的应用,或者还可以为位于本地终端的应用中的插件或软件开发工具包(Software Development Kit,SDK)等功能单元,这些功能单元具体可以由一系列编程语言代码和编程语言代码所实现的库(例如,LIB库等)组成,本实施例对此不进行特别限定。
可以理解的是,所述应用可以是安装在终端上的应用程序(nativeApp),或者还可以是终端上的浏览器的一个网页程序(webApp),本实施例对此不进行限定。
其中,所述身份标识信息可以包括但不限于包名和包签名中的至少一项,本实施例对此不进行特别限定。
可选地,在本实施例的一个可能的实现方式中,所述获取单元31, 具体可以用于调用所述应用所提供的接口,以获得所述身份标识信息。
具体地,所述获取单元31,具体可以用于调用所述应用的Java语言库接口;采用JNI技术,调用所述应用的C语言库接口或C++语言库接口,以调用所述操作系统所提供的接口,以获得所述身份标识信息。
可选地,在本实施例的一个可能的实现方式中,所述获取单元31,还可以进一步用于获取当前的网络时间戳。
相应地,所述签名单元32,具体可以用于对所述身份标识信息和所述网络时间戳进行签名处理,以获得所述第一签名信息;所述发送单元33,具体可以用于向所述开放平台发送所述应用的应用标识信息、所述网络时间戳和所述第一签名信息;所述第二签名信息具体为所述开放平台对所述应用注册的身份标识信息和所述网络时间戳进行签名处理获得的,所述应用注册的身份标识信息为所述开放平台根据所述网络时间戳和所述应用标识信息获得的。
需要说明的是,图1对应的实施例中方法,可以由本实施例提供的开放平台的调用装置实现。详细描述可以参见图1对应的实施例中的相关内容,此处不再赘述。
本实施例中,通过获取单元获取应用的身份标识信息,进而由签名单元对所述身份标识信息进行签名处理,以获得所述应用的第一签名信息,并由发送单元向开放平台发送所述第一签名信息和所述应用的应用标识信息,使得接收单元能够接收所述开放平台发送的访问令牌,用以调用所述开放平台所提供的开放API,由于没有传输明文的验证参数,从而提高了安全平台的调用的安全性。
另外,采用本发明提供的技术方案,由于没有传输明文的密钥信息, 能够避免由于验证参数泄露而导致的安全问题,能够进一步提高安全平台的调用的安全性。
另外,采用本发明提供的技术方案,应用和应用所对应的服务器无需存储密钥信息,能够避免由于验证参数泄露而导致的安全问题,能够进一步提高安全平台的调用的安全性。
另外,采用本发明提供的技术方案,通过利用C语言库接口或C++语言库接口,直接调用操作系统所提供的接口,来获得应用的身份标识信息,使得恶意的应用无法伪造身份标识信息,能够避免由于恶意的应用伪造身份标识信息而导致的安全问题,能够进一步提高安全平台的调用的安全性。
另外,采用本发明提供的技术方案,由于利用C语言库接口或C++语言库接口,实现签名处理所需要的对象即应用的身份标识信息,的获取,攻击者想要完全破解的难度相当大,能够进一步提高安全平台的调用的安全性。
另外,采用本发明提供的技术方案,由于除了第一签名信息和应用的应用标识信息之外,还进一步将当前的网络时间戳作为验证参数,发送给开放平台,以共同参与开放平台对第一签名信息的验证操作,使得攻击者无法通过重放验证参数来通过验证,能够避免由于攻击者利用重放验证参数而导致的安全问题,能够进一步提高安全平台的调用的安全性。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本发明所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能单元的形式实现。
上述以软件功能单元的形式实现的集成的单元,可以存储在一个计算机可读取存储介质中。上述软件功能单元存储在一个存储介质中,包括若干指令用以使得一台计算机装置(可以是个人计算机,服务器,或者网络装置等)或处理器(processor)执行本发明各个实施例所述方法的部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
最后应说明的是:以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。

Claims (12)

  1. 一种开放平台的调用方法,其特征在于,包括:
    获取应用的身份标识信息;
    对所述身份标识信息进行签名处理,以获得所述应用的第一签名信息;
    向开放平台发送所述第一签名信息和所述应用的应用标识信息;
    接收所述开放平台发送的访问令牌,用以调用所述开放平台所提供的开放API,所述访问令牌为所述开放平台利用第二签名信息,对所述第一签名信息进行验证成功之后获得的,所述第二签名信息为所述开放平台对所述应用注册的身份标识信息进行签名处理获得的,所述应用注册的身份标识信息为所述开放平台根据所述应用标识信息获得的。
  2. 根据权利要求1所述的方法,其特征在于,所述获取应用的身份标识信息,包括:
    调用所述应用所提供的接口,以获得所述身份标识信息。
  3. 根据权利要求2所述的方法,其特征在于,所述调用所述应用所提供的接口,以获得所述身份标识信息,包括:
    调用所述应用的Java语言库接口;采用JNI技术,调用所述应用的C语言库接口或C++语言库接口,以调用所述操作系统所提供的接口,以获得所述身份标识信息。
  4. 根据权利要求1~3任一权利要求所述的方法,其特征在于,所述身份标识信息包括包名和包签名中的至少一项。
  5. 根据权利要求1~4任一权利要求所述的方法,其特征在于,所述对所述身份标识信息进行签名处理,以获得所述应用的第一签名信息 之前,还包括:
    获取当前的网络时间戳;
    所述对所述身份标识信息进行签名处理,以获得所述应用的第一签名信息,包括:
    对所述身份标识信息和所述网络时间戳进行签名处理,以获得所述第一签名信息;
    所述向开放平台发送所述第一签名信息和所述应用的应用标识信息,包括:
    向所述开放平台发送所述应用的应用标识信息、所述网络时间戳和所述第一签名信息;
    所述第二签名信息具体为所述开放平台对所述应用注册的身份标识信息和所述网络时间戳进行签名处理获得的,所述应用注册的身份标识信息为所述开放平台根据所述网络时间戳和所述应用标识信息获得的。
  6. 一种开放平台的调用装置,其特征在于,包括:
    获取单元,用于获取应用的身份标识信息;
    签名单元,用于对所述身份标识信息进行签名处理,以获得所述应用的第一签名信息;
    发送单元,用于向开放平台发送所述第一签名信息和所述应用的应用标识信息;
    接收单元,用于接收所述开放平台发送的访问令牌,用以调用所述开放平台所提供的开放API,所述访问令牌为所述开放平台利用第二签名信息,对所述第一签名信息进行验证成功之后获得的,所述第二签名信息为所述开放平台对所述应用注册的身份标识信息进行签名处理获得 的,所述应用注册的身份标识信息为所述开放平台根据所述应用标识信息获得的。
  7. 根据权利要求6所述的装置,其特征在于,所述获取单元,具体用于
    调用所述应用所提供的接口,以获得所述身份标识信息。
  8. 根据权利要求7所述的装置,其特征在于,所述获取单元,具体用于
    调用所述应用的Java语言库接口;采用JNI技术,调用所述应用的C语言库接口或C++语言库接口,以调用所述操作系统所提供的接口,以获得所述身份标识信息。
  9. 根据权利要求6~8任一权利要求所述的装置,其特征在于,所述身份标识信息包括包名和包签名中的至少一项。
  10. 根据权利要求6~9任一权利要求所述的装置,其特征在于,
    所述获取单元,还用于
    获取当前的网络时间戳;
    所述签名单元,具体用于
    对所述身份标识信息和所述网络时间戳进行签名处理,以获得所述第一签名信息;
    所述发送单元,具体用于
    向所述开放平台发送所述应用的应用标识信息、所述网络时间戳和所述第一签名信息;
    所述第二签名信息具体为所述开放平台对所述应用注册的身份标识信息和所述网络时间戳进行签名处理获得的,所述应用注册的身份标识 信息为所述开放平台根据所述网络时间戳和所述应用标识信息获得的。
  11. 一种设备,包括:
    一个或者多个处理器;
    存储器;
    一个或者多个程序,所述一个或者多个程序存储在所述存储器中,当被所述一个或者多个处理器执行时:
    获取应用的身份标识信息;
    对所述身份标识信息进行签名处理,以获得所述应用的第一签名信息;
    向开放平台发送所述第一签名信息和所述应用的应用标识信息;
    接收所述开放平台发送的访问令牌,用以调用所述开放平台所提供的开放API,所述访问令牌为所述开放平台利用第二签名信息,对所述第一签名信息进行验证成功之后获得的,所述第二签名信息为所述开放平台对所述应用注册的身份标识信息进行签名处理获得的,所述应用注册的身份标识信息为所述开放平台根据所述应用标识信息获得的。
  12. 一种非易失性计算机存储介质,所述非易失性计算机存储介质存储有一个或者多个程序,当所述一个或者多个程序被一个设备执行时,使得所述设备:
    获取应用的身份标识信息;
    对所述身份标识信息进行签名处理,以获得所述应用的第一签名信息;
    向开放平台发送所述第一签名信息和所述应用的应用标识信息;
    接收所述开放平台发送的访问令牌,用以调用所述开放平台所提供 的开放API,所述访问令牌为所述开放平台利用第二签名信息,对所述第一签名信息进行验证成功之后获得的,所述第二签名信息为所述开放平台对所述应用注册的身份标识信息进行签名处理获得的,所述应用注册的身份标识信息为所述开放平台根据所述应用标识信息获得的。
PCT/CN2014/093750 2014-08-27 2014-12-12 开放平台的调用方法、装置、设备及非易失性计算机存储介质 WO2016029595A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410427923.5A CN104199654B (zh) 2014-08-27 2014-08-27 开放平台的调用方法及装置
CN201410427923.5 2014-08-27

Publications (1)

Publication Number Publication Date
WO2016029595A1 true WO2016029595A1 (zh) 2016-03-03

Family

ID=52084951

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/093750 WO2016029595A1 (zh) 2014-08-27 2014-12-12 开放平台的调用方法、装置、设备及非易失性计算机存储介质

Country Status (2)

Country Link
CN (1) CN104199654B (zh)
WO (1) WO2016029595A1 (zh)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110851456A (zh) * 2019-11-08 2020-02-28 北京字节跳动网络技术有限公司 一种信息处理方法、电子设备及存储介质
CN112492031A (zh) * 2020-11-30 2021-03-12 上海寻梦信息技术有限公司 开放平台对接方法、装置、设备以及存储介质
CN112583606A (zh) * 2020-12-16 2021-03-30 深圳市欢太科技有限公司 安全校验方法及服务器、终端、存储介质
CN112988273A (zh) * 2021-03-24 2021-06-18 北京沃东天骏信息技术有限公司 异构系统的调用方法和接口管理平台
CN113691377A (zh) * 2021-08-20 2021-11-23 珠海格力电器股份有限公司 设备列表的处理方法与装置
CN115002548A (zh) * 2022-05-19 2022-09-02 深圳前海茂佳软件科技有限公司 电视平台应用接口调用方法、装置、终端设备及存储介质

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104199654B (zh) * 2014-08-27 2019-01-11 百度在线网络技术(北京)有限公司 开放平台的调用方法及装置
CN105988789B (zh) * 2015-02-09 2020-08-28 腾讯科技(深圳)有限公司 第三方应用呼起方法、呼起平台和终端
CN107301097B (zh) * 2016-04-14 2020-05-08 阿里巴巴集团控股有限公司 一种调用java对象、java对象的引用地址信息的存储方法及装置
CN107315948B (zh) * 2016-04-26 2020-09-01 阿里巴巴集团控股有限公司 数据调用方法及装置
CN105871884A (zh) * 2016-05-11 2016-08-17 乐视控股(北京)有限公司 一种身份验证方法及装置
CN107766701B (zh) * 2016-08-19 2021-01-26 北京京东尚科信息技术有限公司 电子设备、动态库文件保护方法及装置
CN106529218B (zh) * 2016-10-28 2020-03-06 新华三技术有限公司 一种应用校验方法和装置
CN108319823A (zh) * 2018-02-02 2018-07-24 广东蜂助手网络技术股份有限公司 一种安卓app签名绑定方法及装置
CN110740136B (zh) * 2019-10-22 2022-04-22 中国建设银行股份有限公司 面向开放银行的网络安全控制方法及开放银行平台
CN111404695B (zh) * 2020-03-16 2023-11-24 思必驰科技股份有限公司 令牌请求验证方法和装置

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102394887A (zh) * 2011-11-10 2012-03-28 杭州东信北邮信息技术有限公司 基于OAuth协议的开放平台安全认证方法和系统
CN103220259A (zh) * 2012-01-20 2013-07-24 华为技术有限公司 Oauth API的使用、调用方法、设备及系统
CN104199654A (zh) * 2014-08-27 2014-12-10 百度在线网络技术(北京)有限公司 开放平台的调用方法及装置

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102378170B (zh) * 2010-08-27 2014-12-10 中国移动通信有限公司 一种鉴权及业务调用方法、装置和系统
CN103701761B (zh) * 2012-09-28 2017-07-18 中国电信股份有限公司 开放接口调用的认证方法与系统
US9866382B2 (en) * 2012-12-21 2018-01-09 Mobile Iron, Inc. Secure app-to-app communication
CN103281187B (zh) * 2013-05-17 2016-12-28 北京网秦天下科技有限公司 安全认证方法、设备和系统

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102394887A (zh) * 2011-11-10 2012-03-28 杭州东信北邮信息技术有限公司 基于OAuth协议的开放平台安全认证方法和系统
CN103220259A (zh) * 2012-01-20 2013-07-24 华为技术有限公司 Oauth API的使用、调用方法、设备及系统
CN104199654A (zh) * 2014-08-27 2014-12-10 百度在线网络技术(北京)有限公司 开放平台的调用方法及装置

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110851456A (zh) * 2019-11-08 2020-02-28 北京字节跳动网络技术有限公司 一种信息处理方法、电子设备及存储介质
CN110851456B (zh) * 2019-11-08 2022-03-29 北京字节跳动网络技术有限公司 一种信息处理方法、电子设备及存储介质
CN112492031A (zh) * 2020-11-30 2021-03-12 上海寻梦信息技术有限公司 开放平台对接方法、装置、设备以及存储介质
CN112492031B (zh) * 2020-11-30 2022-11-04 上海寻梦信息技术有限公司 开放平台对接方法、装置、设备以及存储介质
CN112583606A (zh) * 2020-12-16 2021-03-30 深圳市欢太科技有限公司 安全校验方法及服务器、终端、存储介质
CN112583606B (zh) * 2020-12-16 2023-05-09 深圳市欢太科技有限公司 安全校验方法及服务器、终端、存储介质
CN112988273A (zh) * 2021-03-24 2021-06-18 北京沃东天骏信息技术有限公司 异构系统的调用方法和接口管理平台
CN113691377A (zh) * 2021-08-20 2021-11-23 珠海格力电器股份有限公司 设备列表的处理方法与装置
CN113691377B (zh) * 2021-08-20 2023-04-11 珠海格力电器股份有限公司 设备列表的处理方法与装置
CN115002548A (zh) * 2022-05-19 2022-09-02 深圳前海茂佳软件科技有限公司 电视平台应用接口调用方法、装置、终端设备及存储介质

Also Published As

Publication number Publication date
CN104199654B (zh) 2019-01-11
CN104199654A (zh) 2014-12-10

Similar Documents

Publication Publication Date Title
WO2016029595A1 (zh) 开放平台的调用方法、装置、设备及非易失性计算机存储介质
US10305903B2 (en) Bypassing certificate pinning
US10148693B2 (en) Exploit detection system
US10740747B2 (en) NFC-enabled devices for performing secure contactless transactions and using HCE
US10165443B2 (en) Transmitting management commands to a client device
CN104199657B (zh) 开放平台的调用方法及装置
US10867049B2 (en) Dynamic security module terminal device and method of operating same
US10262146B2 (en) Application-to-application messaging over an insecure application programming interface
US11770385B2 (en) Systems and methods for malicious client detection through property analysis
EP2839401A1 (en) Secure password-based authentication for cloud computing services
CN111865882B (zh) 一种微服务认证方法和系统
CN107835185B (zh) 一种基于ARM TrustZone的移动终端安全服务方法及装置
CN112448930A (zh) 账号注册方法、装置、服务器及计算机可读存储介质
CN110113351A (zh) Cc攻击的防护方法及装置、存储介质、计算机设备
EP3179751B1 (en) Information sending method and apparatus, terminal device, and system
US10826901B2 (en) Systems and method for cross-channel device binding
CN112416624B (zh) 基于开放平台的应用数据交互方法及系统
CN106230860A (zh) 发送流媒体的方法和装置
CN104092733B (zh) 一种基于hdfs的可信分布式文件系统
CN108574658B (zh) 一种应用登录方法及其设备
CN109886011B (zh) 一种安全防护方法和装置
WO2023034852A1 (en) Software posture for zero trust access
KR20220124940A (ko) 허위 기지국 대응을 위한 전자서명 기반의 SIB(System Information Block) 메시지 송/수신 방법 및 장치
CN115941217A (zh) 用于安全通信的方法和其相关产品
CN105323287B (zh) 第三方应用程序的登录方法及系统

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: 14900899

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: 14900899

Country of ref document: EP

Kind code of ref document: A1