WO2020088213A1 - 服务授权方法及通信装置 - Google Patents

服务授权方法及通信装置 Download PDF

Info

Publication number
WO2020088213A1
WO2020088213A1 PCT/CN2019/110638 CN2019110638W WO2020088213A1 WO 2020088213 A1 WO2020088213 A1 WO 2020088213A1 CN 2019110638 W CN2019110638 W CN 2019110638W WO 2020088213 A1 WO2020088213 A1 WO 2020088213A1
Authority
WO
WIPO (PCT)
Prior art keywords
server
access token
service
request message
authorization
Prior art date
Application number
PCT/CN2019/110638
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 华为技术有限公司
Priority to EP19878158.5A priority Critical patent/EP3863253A4/en
Publication of WO2020088213A1 publication Critical patent/WO2020088213A1/zh
Priority to US17/237,297 priority patent/US20210250344A1/en

Links

Images

Classifications

    • 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/083Network architectures or network communication protocols for network security for authentication of entities using passwords
    • 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/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/321Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving a third party or a trusted authority
    • H04L9/3213Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving a third party or a trusted authority using tickets or tokens, e.g. Kerberos
    • 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
    • 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
    • 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/0884Network architectures or network communication protocols for network security for authentication of entities by delegation of authentication, e.g. a proxy authenticates an entity to be authenticated on behalf of this entity vis-à-vis an authentication entity
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/10Network architectures or network communication protocols for network security for controlling access to devices or network resources
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/55Push-based network services
    • 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/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/088Usage controlling of secret information, e.g. techniques for restricting cryptographic keys to pre-authorized uses, different access levels, validity of crypto-period, different key- or password length, or different strong and weak cryptographic algorithms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/06Authentication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/08Access security
    • H04W12/084Access security using delegated authorisation, e.g. open authorisation [OAuth] protocol

Definitions

  • This application relates to the field of communications, and in particular to a service authorization method and a communication device.
  • a service-based architecture such as the core network (CN) of the 5th generation (5G) mobile communication system
  • different network functions are usually based on the client ( Client / server communication mode.
  • the requester is the client and the responder is the server.
  • the service-based architecture also supports the service authorization function.
  • the server may include an authorization server (authority server) and a function server (function server).
  • the client applies to the authorization server for authorization information of the client to access the function server, such as an access token, and then the client accesses the function server according to the applied authorization information, and the function server performs access authorization to the client according to the authorization information.
  • the embodiments of the present application provide a service authorization method and a communication device, which can solve the problem that the first server accesses the second server without the service authorization in the scenario where the second server is discovered by the client.
  • a service authorization method including: a client sends a first service request message to a first server.
  • the first service request message carries service authorization information; the service authorization information is used when the first server accesses the second server.
  • the first service request message sent by the client to the first server carries the service authorization information of the first server to access the second server, so that the first server accesses the second server according to the above service authorization information
  • the server can solve the problem that the first server accesses the second server without service authorization in the scenario where the second server is discovered by the client, so as to reduce the security risk of the serviced network.
  • the service authorization for the first server to access the second server may be obtained in the following two ways.
  • the client may apply for the service authorization on behalf of the client and notify the first server.
  • the client applies for an access token for the first server to access the second server, and sends the access token to the first server.
  • the client may send the relevant information of the second server to the first server, and then the first server may apply for the above-mentioned service authorization by itself.
  • the client may send the instance identifier or resource identifier of the second server to the first server, and then the first server may apply for an access token to access the second server according to the instance identifier or resource identifier of the second server.
  • service authorization information may be an access token, such as a JSON Web token, or other forms of service access authorization information, which is not limited in this application.
  • the service authorization information includes an access token. It can be understood that before the client sends the first service request message to the first server, the foregoing service authorization method may further include: the client sends an access token request message to the authorization server. The access token request message carries the instance ID of the client and the instance ID of the first server. Then, the client receives the access token response message sent by the authorization server. The access token response message carries the above access token.
  • the client sending the first service request message to the first server may include: the client sending the first service request message to the first server; wherein the first service request message includes the above access token.
  • the client is the requester of the access token of the second server, and the first server is the requester of the service of the second server. Therefore, the above access token needs to include the instance identifier of the first server.
  • the client does not need to access the second server, that is, the client is not the service requester of the second server, the client only needs to apply for an access token for the first server, and does not need to apply for an access token for itself.
  • the above access token may not include the instance identification of the client.
  • the client needs to access the second server, that is to say: the client is both the requester of the access token of the second server and the service requester of the second server, the client needs to be Apply for an access token to access the second server.
  • the above access token may include the instance identifier of the client and the instance identifier of the first server.
  • the above access token request message may also carry the network function type of the client and the network function type of the first server, so that the authorization server determines whether to authorize the first server according to the network function type of the client and the network function type of the first server Access the second server.
  • the above access token may further include a server instance list and a service name list of the server accessible by the above client and / or the first server.
  • the service authorization information may include the access token.
  • the above access token may also include an instance identifier of the authorization server.
  • a validity period may also be set for the above access token.
  • the above access token may also include the access token expiration time. Accordingly, the above service authorization method may further include: if the client determines that the access token has expired through the access token expiration time, the client applies to the authorization server for a new access token, and notifies the first of the new access token to the first server.
  • the client may also provide the first server with information about the second server, such as the instance identifier of the second server, Or the resource identifier of the second server, so that the first server can apply for the service access right from the authorization server according to the above information of the second server, such as an access token.
  • the service authorization information may also include a service name that the first server needs to access. Therefore, optionally, when the service authorization information includes an instance identifier of the second server, or the service authorization information includes a resource identifier of the second server, the service authorization information may further include the service name of the second server.
  • the service name of the second server is the service name that the first server needs to access.
  • the access token is applied for by the first server.
  • the access token is applied for by the first server.
  • a service authorization method which includes: a first server receives a first service request message sent by a client.
  • the first service request message carries service authorization information.
  • the first server obtains the access token according to the service authorization information.
  • the access token is used when the first server accesses the second server.
  • the first server sends a second service request message to the second server.
  • the second service request message carries an access token.
  • the first server applies for its service authorization to access the second server according to the service authorization information carried in the first service request message sent by the client, and accesses the The second server can solve the problem that the first server accesses the second server without service authorization in the scenario where the second server is discovered by the client, so as to reduce the security risk of the serviced network.
  • service authorization method provided in the second aspect corresponds to the above-mentioned service authorization method two.
  • the foregoing service authorization information includes an instance identifier of the second server. Therefore, the above-mentioned first server acquiring the access token according to the service authorization information may include: the first server sends an access token request message to the authorization server. The access token request message carries the instance identifier of the second server. Then, the first server receives the access token response message sent by the authorization server. The access token response message carries the access token, and the access token is generated by the authorization server according to the instance identifier of the second server.
  • the foregoing service authorization information includes the resource identifier of the second server. Therefore, the above-mentioned first server obtains the access token according to the service authorization information, which may include the following two stages: a network function discovery stage and an access token request stage.
  • the network function discovery stage may include: the first server sends a network function discovery request message to the authorization server.
  • the network function discovery request message carries the host name of the second server; the host name of the second server is part of the resource identifier of the second server.
  • the first server receives the network function discovery response message sent by the authorization server.
  • the network function discovery response message carries the instance identifier of the second server.
  • the above access token request stage may include: the first server sends an access token request message to the authorization server.
  • the access token request message carries the instance identifier of the second server.
  • the first server receives the access token response message sent by the authorization server.
  • the access token response message carries the access token, and the access token is generated by the authorization server according to the instance identifier of the second server.
  • the foregoing service authorization information includes the resource identifier of the second server. Therefore, the above-mentioned first server obtains the access token according to the service authorization information, which includes: the first server sends an access token request message to the authorization server.
  • the access token request message carries the host name of the second server; the host name of the second server is part of the resource identifier of the second server.
  • the first server receives the access token response message sent by the authorization server.
  • the access token response message carries the access token, and the access token is generated by the authorization server according to the host name of the second server.
  • the access token applied by the first server by itself includes the instance identifier of the second server.
  • the access token applied for by the first server for itself may include: an instance ID of the authorization server, an instance ID of the first server, an instance ID of the second server, and a list of service names, and the expiration time of the access token;
  • the access token applied by the first server for itself may include: an instance identifier of the authorization server, an instance identifier of the first server, a list of instance identifiers of the authorized server, and a list of service names, and the expiration time of the access token.
  • the list of instance IDs of authorized servers includes the instance IDs of the second server, and the service name list of authorized servers includes the service names of the second server.
  • the first server only needs to apply for an access token to access the second server for itself. Therefore, the access token applied for by the first server for itself may not include the instance identifier of the client.
  • the first server receives the first service request message sent by the client; wherein, the first service request message carries an access token;
  • the first server sends a second service request message to the second server; wherein the second service request message carries the access token.
  • a communication device including: a sending module.
  • the sending module is used to send the first service request message to the first server.
  • the first service request message carries service authorization information; the service authorization information is used when the first server accesses the second server.
  • the foregoing service authorization information includes an access token
  • the communication device further includes: a receiving module.
  • the above sending module is also used to send an access token request message to the authorization server before the sending module sends the first service request message to the first server.
  • the access token request message carries the instance identifier of the communication device and the instance identifier of the first server.
  • the receiving module is used to receive the access token response message sent by the authorization server.
  • the access token response message carries the access token.
  • the sending module is also used to send the first service request message to the first server.
  • the first service request message includes an access token.
  • the access token includes the instance identifier of the first server.
  • the access token includes the instance identifier of the communication device and the instance identifier of the first server.
  • the access token request message also carries the network function type of the communication device and / or the network function type of the first server.
  • the above access token may further include an access token expiration time
  • the communication device described in the third aspect may further include: a processing module.
  • the processing module is used to control the sending module and the receiving module to apply for a new access token to the authorization server if the access token has expired to determine that the access token has expired, and control the sending module to notify the new access token to the first One server.
  • the service authorization information when the service authorization information includes the instance identification of the second server, or the service authorization information includes the resource identification of the second server, the service authorization information further includes the service name of the second server; the service name of the second server is the first The service name that the server needs to access.
  • the communication device described in the third aspect may be the above client, or may be a chip system provided in the above client, which is not limited in this application.
  • a communication device including: a receiving module, a sending module, and an acquiring module.
  • the receiving module is used to receive the first service request message sent by the client.
  • the first service request message carries service authorization information.
  • the obtaining module is used to obtain the access token according to the service authorization information.
  • the access token is used when the communication device accesses the second server.
  • the sending module is configured to send a second service request message to the second server. Among them, the second service request message carries an access token.
  • the foregoing service authorization information includes an instance identifier of the second server.
  • the sending module is also used to send an access token request message to the authorization server.
  • the access token request message carries the instance identifier of the second server.
  • the receiving module is also used to receive the access token response message sent by the authorization server.
  • the access token response message carries the access token, and the access token is generated by the authorization server according to the instance identifier of the second server.
  • the above service authorization information includes the resource identifier of the second server.
  • the sending module is also used to send a network function discovery request message to the authorization server.
  • the network function discovery request message carries the host name of the second server; the host name of the second server is part of the resource identifier of the second server.
  • the receiving module is also used to receive the network function discovery response message sent by the authorization server.
  • the network function discovery response message carries the instance identifier of the second server.
  • the sending module is also used to send an access token request message to the authorization server.
  • the access token request message carries the instance identifier of the second server.
  • the receiving module is also used to receive the access token response message sent by the authorization server.
  • the access token response message carries the access token, and the access token is generated by the authorization server according to the instance identifier of the second server.
  • the foregoing service authorization information includes the resource identifier of the second server.
  • the sending module is also used to send an access token request message to the authorization server.
  • the access token request message carries the host name of the second server; the host name of the second server is part of the resource identifier of the second server.
  • the receiving module is also used to receive the access token response message sent by the authorization server.
  • the access token response message carries the access token, and the access token is generated by the authorization server according to the host name of the second server.
  • the access token applied by the first server by itself includes the instance identifier of the second server.
  • the communication device described in the fourth aspect may be the above-mentioned first server or a chip system provided in the above-mentioned first server, which is not limited in this application.
  • a communication device including: a processor and a transceiver.
  • the processor is coupled to the memory; the processor is used to execute the computer program stored in the memory, so that the communication device executes the service authorization method described in any one of the first aspect and various optional implementations thereof, or Perform the service authorization method as described in any one of the second aspect and various optional implementations thereof.
  • the communication device described in the fifth aspect may be the client or the first server, or may be a chip system provided in the client or the first server, which is not limited in this application.
  • a communication system in a sixth aspect, includes the client and the first server, and the authorization server and the second server.
  • a computer-readable storage medium that stores a program or instruction, and when the program or instruction runs on a computer, causes the computer to perform any one of the first aspect and various optional implementations thereof
  • a computer program product including: computer program code; when the computer program code runs on a computer, the computer is caused to execute the program as described in any one of the first aspect and various optional implementations thereof The service authorization method, or execute the service authorization method described in any one of the second aspect and various optional implementations thereof.
  • FIG. 1 is a schematic structural diagram of a communication system to which a service authorization method provided by an embodiment of this application is applicable;
  • FIG. 2 is a schematic flowchart of a communication method based on a client / server model
  • FIG. 3 is a schematic flowchart of a communication method based on the client / server model communication method 1;
  • 4A is a schematic flowchart 1 of a communication method based on a communication method of a client / server model
  • 4B is a second schematic flowchart of a communication method based on the client / server model communication method 2;
  • FIG. 5 is a first schematic flowchart of a service authorization method based on a service authorization method 1 provided by an embodiment of the present application;
  • FIG. 6 is a second schematic flowchart of a service authorization method based on a service authorization method 1 provided by an embodiment of this application;
  • FIG. 7 is a third schematic flowchart of a service authorization method based on a service authorization method 1 provided by an embodiment of this application;
  • FIG. 8 is a schematic flowchart 1 of a service authorization method based on a service authorization method 2 provided by an embodiment of the present application;
  • FIG. 9 is a second schematic flowchart of a service authorization method based on a service authorization method 2 provided by an embodiment of this application;
  • FIG. 10 is a schematic flowchart 3 of a service authorization method based on a service authorization method 2 provided by an embodiment of the present application;
  • FIG. 11 is a fourth schematic flowchart of a service authorization method based on service authorization method 2 according to an embodiment of the present application.
  • FIG. 12 is a schematic flowchart 5 of a service authorization method based on a service authorization method 2 provided by an embodiment of this application;
  • FIG. 13 is a schematic flowchart 6 of a service authorization method based on a service authorization method 2 according to an embodiment of the present application;
  • FIG. 14 is a seventh schematic flowchart of a service authorization method based on a service authorization method 2 provided by an embodiment of this application;
  • 15 is a schematic structural diagram 1 of a communication device according to an embodiment of the present application.
  • 16 is a second structural diagram of a communication device according to an embodiment of the present application.
  • 17 is a schematic structural diagram 3 of a communication device according to an embodiment of the present application.
  • FIG. 19 is a schematic structural diagram of yet another communication device provided by an embodiment of the present application.
  • the technical solutions of the embodiments of the present application can be applied to various communication systems, such as a 5th generation (5th generation, 5G) mobile communication system, and future communication systems, such as a 6G system.
  • 5th generation, 5G 5th generation
  • 6G 6th generation
  • the subscript such as W 1 may be typo mistaken as a non-subscript form such as W 1.
  • the meaning to be expressed is consistent.
  • the network architecture and business scenarios described in the embodiments of the present application are intended to more clearly explain the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application. With the evolution of the architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
  • the communication system shown in FIG. 1 is taken as an example to describe in detail the communication system applicable to the embodiments of the present application.
  • the communication system includes user equipment (UE), a radio access network (RAN), and a core network (CN).
  • UE user equipment
  • RAN radio access network
  • CN core network
  • User equipment can access a wireless access network through an access network device such as a base station, and establish a communication connection with an external data network (DN) through a core network.
  • the core network is mainly used for user equipment registration, security authentication, mobility management, location management, session management, and forwarding of data packets between the user equipment and external data networks.
  • the above wireless access network may be a next generation access network (NG-AN).
  • the above core network includes the following network functions: session management function (session management function, SMF), access and mobility management function (access and mobility management function, AMF), user plane function (user plane function, UPF), unified data Management (unified data management, UDM), policy control function (PCF), authentication service function (authentication server function (AUSF), network slice selection function (network slice selection function, NSSF), network open function (network exposure (function, NEF), network warehouse function (network repository function, NRF), application function (application function, AF), etc.
  • the above core network may include one or more core network devices.
  • the core network device may be a network element for performing the above-mentioned single network function, or may be a network element for performing the above-mentioned multiple network functions.
  • the core network device may include one or more functional modules for performing the foregoing multiple network functions, and the functional module may be a software module or It is a software and hardware module, which is not limited in the embodiments of the present application.
  • network functions and network elements, devices, and function modules for performing the above network functions, as well as chip systems provided inside the above network elements and devices, are collectively referred to as network functions hereinafter.
  • the core network of the above communication system may adopt a service-based architecture (SBA). That is to say, the above-mentioned different network functions can communicate based on the client-server mode. Among them, the service consumer is called the client, and the service provider is called the server. Specifically, the control plane network functions such as the above-mentioned access and mobility management functions, session management functions, policy control functions, and unified data management functions can use service-based interfaces for interaction.
  • SBA service-based architecture
  • the service interface provided by the access and mobility management function can be Namf
  • the service interface provided by the session management function can be Nsmf
  • the service interface provided by the policy control function can be Npcf
  • unified data The service interface provided by the management function can be Nudm and so on.
  • the above-mentioned access network device is a device that is located on the network side of the above-mentioned communication system and has a wireless transceiver function or a chip that can be installed in the device.
  • the access network equipment includes but is not limited to: evolved Node B (evolved Node B, eNB), radio network controller (radio network controller, RNC), node B (Node B, NB), base station controller (base station controller) , BSC), base transceiver station (BTS), home base station (eg, home evolved NodeB, or home NodeB, HNB), baseband unit (BBU), wireless fidelity (WIFI)
  • the access point (access point, AP), wireless relay node, wireless backhaul node, transmission point (transmission and reception point, TRP or transmission point, TP) in the system can also be 5G, such as the new air interface (new (radio, NR) gNB in the system, or, transmission point (TRP or TP), one or a group
  • the user equipment is a terminal device that is connected to the communication system and has a wireless transceiver function or a chip that can be installed in the terminal device.
  • the user equipment may also be referred to as a user device, access terminal, user unit, user station, mobile station, mobile station, remote station, remote terminal, mobile device, user terminal, terminal, wireless communication device, user agent, or user device.
  • the terminal devices in the embodiments of the present application may be mobile phones, tablet computers, computers with wireless transceiver functions, virtual reality (virtual reality, VR) terminal devices, and augmented reality (augmented reality, AR) terminals.
  • Wireless terminals in equipment industrial control (industrial control), wireless terminals in self-driving (self-driving), wireless terminals in remote medical (remote medical), wireless terminals in smart grid (smart grid), transportation safety ( Wireless terminal in transportation, wireless terminal in smart city, wireless terminal in smart home, etc.
  • FIG. 1 is only a simplified schematic diagram for ease of understanding and examples.
  • the communication system may also include other network devices or other terminal devices, which are not shown in FIG. 1.
  • the above network warehouse function also integrates the function of the OAuth2.0 authorization server.
  • FIG. 2 shows a schematic flowchart of a communication method based on the above-mentioned OAuth2.0 authorization service mechanism.
  • the communication method based on the above OAuth2.0 authorization service mechanism may generally include S201-S204:
  • the client applies to the authorization server for an access token to access the server.
  • the authorization server authenticates the client, and assigns an access token to the client that passes the authentication.
  • the client sends a service request to the server to access the resources provided by the server.
  • the service request carries the access token obtained in S202.
  • the server determines the validity of the access token. If it is valid, the client is allowed to access its own resources and reply to the service response message.
  • FIG. 3 shows a flowchart of a communication method based on the communication method 1 of the OAuth2.0 authorization service mechanism. As shown in FIG. 3, the communication method includes S301-S306:
  • the first client sends a network function discovery request message to the network warehouse function, where the network function discovery request message carries information such as the target network function type, service name list, and network function type of the first client.
  • the network warehouse function returns the list of servers that meet the request conditions to the first client according to the network function discovery request message.
  • the server list includes information of one or more servers, and the server information includes instance identifiers and network function types of the servers.
  • the first client can select a target server in the server list, such as the second server to access.
  • the target server can be selected based on the principles of load balancing and priority.
  • the first client accesses the resources provided by the first server, and sends a first service request message to the first server.
  • the first service request message carries the resource identifier of the second server.
  • the resource identifier of the second server may be a uniform resource identifier (URI) of the second server
  • the resource identifier of the second server may be the second server obtained by the first client according to step 2 Information generation.
  • the first server replies to the first service request response message.
  • the first service request response message carries the resource requested by the first client.
  • the first server simultaneously serves as a second client, and sends a second service request message to the second server according to the resource identifier of the second server.
  • the second service request message is used to request access to resources provided by the second server;
  • the second server returns a second service response message.
  • the second service request response message carries the resource requested by the first server.
  • FIG. 4A shows a flowchart of a communication method based on the communication method 2 of the OAuth2.0 authorization service mechanism.
  • the second communication method shown in FIG. 4A is the subscribe / notify mode in the 5G system.
  • the client serves as the service consumer
  • the server serves as the service provider
  • the service consumer subscribes to network events that occur on the service provider.
  • the service provider sends an event notification message to the service consumer.
  • the communication method includes S401-S404:
  • the first client sends a subscription request message to the first server.
  • the subscription request message carries the subscription event and the resource identifier of the second server, and the resource identifier of the second server is a uniform resource identifier of the second server.
  • the first server replies to the subscription response.
  • the first server simultaneously serves as the second client, and sends an event notification to the second server according to the resource identifier of the second server.
  • the second server replies with an event notification response.
  • the first client simultaneously serves as the second server.
  • FIG. 4B shows a flowchart of another communication method based on the communication method 2 of the OAuth2.0 authorization service mechanism.
  • the difference between FIG. 4B and FIG. 4A is that the second server in FIG. 4B is another network function, not the first client.
  • the above two communication methods have in common that the second client serves as the first server, and accesses the resources provided by the second server through the resource identifier of the second server provided by the first client.
  • the second client does not obtain the service authorization of the second server.
  • the second client accesses the second server without being authorized by the service, and there is a high network security risk. Therefore, how to implement the service authorization of the first server as the second client to access the second server in the scenario where the second server is discovered by the first client has become an urgent problem to be solved.
  • first client is referred to as a “client”
  • first server and the “second client” are collectively referred to as a “first server”.
  • the service authorization for the first server to access the second server can be obtained through one of the following two service authorization methods.
  • the client may apply for the access right of the first server to access the second access on behalf of the client, and notify the first server.
  • the client may apply for an access token for the first server to access the second server instead, and send the access token to the first server.
  • the client can send the related information of the second server to the first server, and then the first server can apply for the access right to access the second server.
  • the client may send the instance identifier or resource identifier of the second server to the first server, and then the first server may apply for an access token to access the second server according to the instance identifier or resource identifier of the second server.
  • the access right for the first server to access the second server may be an access token, such as a JSON Web token, or other forms of access permission, which is not limited in this application.
  • service authorization method 1 and service authorization method 2 are described below in conjunction with the drawings.
  • FIG. 5 shows a schematic flowchart of a service authorization method based on service authorization method 1 provided by an embodiment of the present application, and is applicable to communication between different network functions in the communication system shown in FIG. 1.
  • the service authorization method includes S501-S504:
  • the client sends a first service request message to the first server.
  • the client receives the first service response message sent by the first server.
  • the first service request message carries service authorization information.
  • the service authorization information is used when the first server accesses the second server.
  • the above service authorization information may include an access token.
  • the access token can be applied for by the client in advance, or it can be sent to the client after applying for other network functions except the client and the first server, and then forwarded by the client to the first server. There is no restriction on this.
  • the service authorization method may also include S601-S602:
  • the client sends an access token request message to the authorization server.
  • the access token request message carries the instance ID of the client and the instance ID of the first server.
  • the client receives the access token response message sent by the authorization server.
  • the access token response message carries the access token.
  • the client is the applicant for the access token. Therefore, the above access token request message needs to carry the instance identifier of the client, so that the authorization server sends the generated access token to the access token applicant, and The access token user is notified by the access token applicant.
  • the above access token request message also needs to include the instance identifier of the first server.
  • the client does not need to access the second server, that is, the client is not a service consumer of the second server, the client only needs to apply for an access token for the first server, and does not need to apply for an access token for itself.
  • the client indicates the instance identifier of the client as the instance identifier of the access token requester in the access token request message, and indicates the instance identifier of the first server as the instance identifier of the service consumer.
  • the authorization server allocates an access token, which may not include the instance identifier of the client.
  • the client needs to provide Both servers apply for an access token to access the second server.
  • the client indicates the instance ID of the client and the instance ID of the first server as the instance ID of the service consumer in the access token request message.
  • the authorization server distributes the access token.
  • the access token needs to include the instance identifier of the client and the instance identifier of the first server.
  • the above access token request message may also carry the network function type of the client and / or the network function type of the first server, the network function type of the second server and the list of desired service names, so that the authorization server The function type and / or the network function type of the first server, the network function type of the second server and the list of desired service names, determine the authorized client and / or the first server to access the second server of the network function type, and generate Access token.
  • the access token also includes a list of network function types and desired service names of the second server.
  • the above access token request message may also carry the instance identifier of the second server and a list of desired service names.
  • the service name list of the desired server may include the service name of one or more second servers.
  • the above access token may further include an instance identifier and a service name list of the second server.
  • the access token may further include an instance identifier of the authorization server, which is used to indicate the identity information of the authorizer of the access token.
  • the access token may further include an access token expiration time, so that the access token is expired and refreshed, and the security of the network is enhanced.
  • the S501 client sends a first service request message to the first server, which can be specifically implemented as the following steps:
  • the client sends a first service request message to the first server; where the first service request message includes the aforementioned access token.
  • the authorization server may also set a validity period for the above access token.
  • the above access token may also include the access token expiration time. Accordingly, the above service authorization method may further include the following steps:
  • the client determines that the access token has expired through the access token expiration time, the client applies to the authorization server for a new access token, and notifies the first server of the new access token.
  • the first server sends a second service request message to the second server, where the message carries the access token.
  • the first server receives the second service response message sent by the second server.
  • the first server sends the obtained access token to the second server, and the second server determines that the first server is allowed to access the resources on it by checking the validity of the access token.
  • the service authorization method shown in FIG. 6 is specifically described below through the capability opening process in the 5G system.
  • the unified data management function is the client
  • the access and mobility management function is the first server
  • the network opening function is the second server
  • the network warehouse function is the authorization server.
  • the application function sends an event subscription request message to the network opening function.
  • the event subscription request message is used to subscribe to one or more network events, and the event subscription request message carries information such as the subscription event and the resource identifier of the application function.
  • the network opening function sends an event subscription request message to the unified data management function.
  • the event subscription request message carries the resource identifier of the network open function.
  • the event subscription request message can also carry the network function type.
  • the network function type is network open function.
  • the unified data management function sends an access token request message to the network warehouse function.
  • the access token request message carries the instance ID and network function type of the unified data management function, the instance ID and network function type of the access and mobility management function, the desired network function type, and the desired service name list.
  • the desired network function type is a network open function (obtained from S702), and the desired service name list may be a wildcard or a subscription / notification indication.
  • the network warehouse function determines the resources authorized to access the network open function according to the information carried in the access token request message, generates an access token, and sends it to the unified data management function.
  • determining the resource authorized to access the network open function and generating the access token can be accomplished by one of the following two token generation methods:
  • the network warehouse function determines to allow the unified data management function to request access tokens, and allows access and mobility management functions to access resources of the network open function.
  • the network warehouse function generates an access token.
  • the access token contains the instance identifier of the network warehouse function, the instance identifier of the access and mobility management function, the authorized network function type and the list of service names, and the access token expiration time.
  • the authorized network function type is network open function.
  • the instance ID and network function type of the unified data management function, the instance ID and network function type of the access and mobility management function in the access token request message are the instance ID and network function type of the service consumer, then the network warehouse function Make sure that unified data management functions and access and mobility management functions are allowed to access resources provided by network open functions.
  • the network warehouse function generates an access token.
  • the access token contains the instance ID of the network warehouse function, the instance ID of the unified data management function, the instance ID of the access and mobility management function, the list of authorized network function types and service names, and the expiration time of the access token.
  • the authorized network function type is network open function.
  • the access token may be a JSON Web token, such as an access token that uses JSON Web signature (JSON Web signature (JWS)).
  • JSON Web signature JWS
  • the JSON Web signature can be a digital signature or message authentication codes (message authentication codes, MACs).
  • the resource identifier of the above network open function may be a uniform resource identifier.
  • the instance identifier of the unified data management function, the instance identifier of the access and mobility management function, and the instance identifier of the network warehouse function may be the instance identifier of the network function in a universally unique identifier (UUID) format.
  • UUID universally unique identifier
  • the unified data management function determines that the service name list in the access token returned in S704 is a wildcard or subscription / notification indication, the unified data management function sends an event subscription request message to the access and mobility management function.
  • the event subscription request message carries the resource identifier and access token of the network open function.
  • the access and mobility management function returns an event subscription response to the unified data management function.
  • the unified data management function returns an event subscription response to the network open function.
  • the network opening function returns an event subscription response to the application function.
  • access and mobility management function determines that the list of service names in the access token is a wildcard or subscription / notification indication, and the access and mobility management function detects that the above subscription event is triggered, then access and mobility management The function sends an event notification to the network opening function corresponding to the resource identification of the network opening function. Among them, the above event notification carries an access token.
  • the network opening function verifies the validity of the access token, such as verifying the signature with the authorization server public key or verifying the MACs value with the shared key. If the verification is passed, it means that the access and mobility management function is allowed to access the resource, and the network open function sends an event notification to the application function.
  • the application function returns an event notification response to the network opening function.
  • the network opening function returns an event notification response to the access and mobility management function.
  • the first service request message sent by the client to the first server carries the service authorization information of the first server to access the second server, so that the first server accesses the second server according to the above service authorization information
  • the server can solve the problem that the first server accesses the second server without service authorization in the scenario where the second server is discovered by the client, so as to reduce the security risk of the serviced network.
  • the client can also provide the first server with information about the second server, such as the instance identifier of the second server, or the resource identifier of the second server, etc.
  • information about the second server such as the instance identifier of the second server, or the resource identifier of the second server, etc.
  • a server applies to the authorization server for access rights of the second server, such as an access token.
  • FIG. 8 shows a schematic flowchart of a service authorization method based on service authorization method 2 provided in an embodiment of the present application.
  • the service authorization method includes S801-S805:
  • the client sends a first service request message to the first server.
  • the client receives the first service response message sent by the first server.
  • the first service request message carries service authorization information.
  • the foregoing service authorization information includes an instance identifier of the second server.
  • the service authorization information includes a resource identifier of the second server, such as the URI of the second server.
  • the URI can adopt a data structure in the following format:
  • the URI may include the host name of the second server.
  • the host name of the second server is the apiRoot field in the URI, or the authority / host field in the apiRoot field.
  • the first server obtains the access token according to the service authorization information.
  • the access token is used when the first server accesses the second server.
  • the foregoing service authorization information includes an instance identifier of the second server.
  • the S803 first server obtains the access token according to the service authorization information, which may include S901-S902:
  • the first server sends an access token request message to the authorization server.
  • the access token request message carries the instance identifier of the second server, so that the authorization server determines that the first server has permission to access the second server according to the instance identifier of the second server, and generates an access token for it.
  • the access token request message may also carry the instance identifier of the first server and a list of desired service names.
  • the desired service name list may include service names of one or more second servers.
  • the authorization server determines that the first server can authorize access to the resources of the second server according to the information carried in the access token request message, and generates an access token. And execute the following S902.
  • the authorization server determines that the first server can authorize access to the resources of the second server according to the information carried in the access token request message, which may include the following steps:
  • the authorization server determines that the first server is allowed to access the second server, and a list of desired service names.
  • the generated access token may include the instance ID of the authorization server, the instance ID of the first server, the instance ID of the second server and the list of service names, and the expiration time of the access token.
  • the access token is a JSON Web token, such as an access token that uses JSON Web signature (JSON Web signature (JWS)).
  • JSON Web signature JWS
  • the JSON Web signature can be a digital signature or a message authentication code (message authentication, MACES).
  • the resource identifier of the second server may be a uniform resource identifier.
  • the instance ID of the authorization server, the instance ID of the first server, and the instance ID of the second server may be an instance ID of a network function in a globally unique identifier (UUID) format.
  • UUID globally unique identifier
  • the first server receives the access token response message sent by the authorization server.
  • the access token response message carries the access token.
  • the access token is generated by the authorization server according to the instance identifier of the second server.
  • the access and mobility management function is a client
  • the visiting session management function is a first server
  • the home session management function is a second server
  • the network warehouse function is an authorization server.
  • the service authorization method shown in FIG. 9 may be specifically implemented as S1001-S1012:
  • S1001 The user equipment sends a PDU session establishment request to the access and mobility functions through the base station.
  • the access and mobility management functions select the session management function of the visited site and the session management function of the home site.
  • the appropriate session management function can be selected through the network element warehouse function.
  • the access and mobility management function sends a session management context establishment request to the visited session management function.
  • the request for establishing a session management context carries the resource identification of the home session management function and the instance identification of the home session management function.
  • the visited session management function sends a session management context establishment response to the access and mobility management function.
  • the visitor session management function selects the visitor user plane function and sends an N4 session establishment request message to the visitor site user plane function.
  • the visited user plane function sends an N4 session establishment response message to the visited session management function.
  • the visitor session management function sends an access token request message to the network warehouse function.
  • the access token request message carries the instance identifier of the visited session management function, the instance identifier of the attributable session management function, and a list of desired service names.
  • the instance identifier of the attribution session management function is obtained from S1003A, and the desired service name list includes the service name of the service to be called in S1006 described below.
  • the network warehouse function determines the resources authorized to access the home session management function based on the information carried in the access token request message, generates an access token, and sends an access token response message to the visited session management function.
  • the network warehouse function determines that the visiting session management function is allowed to access the home session management function, and the desired service name list corresponding to the home session management function, the network warehouse function generates an access token.
  • the access token contains the instance ID of the network warehouse function, the instance ID of the session management function in the visited place, the instance ID and service name list of the session management function in the home place, and the expiration time of the access token.
  • the access token is a JSON Web token, such as an access token that uses JSON Web signature (JSON Web signature (JWS)).
  • JSON Web signature JWS
  • the JSON Web signature can be a digital signature or message authentication codes (message authentication codes, MACs).
  • the resource identifier of the above-mentioned home session management function may be a unified resource identifier, and the instance identifier of the network warehouse function, the instance ID of the visited session management function, and the instance ID of the home session management function may be UUID format network function .
  • the visitor session management function determines that the service name of the home session management function that needs to be called is included in the service name list of the home session management function received in S1005B, the visitor session management function transfers to the home session management function
  • the resource identification representative of the attribution session management function sends a session establishment request message. Among them, the session establishment request message carries the access token.
  • the home session management function obtains the session management contract data corresponding to the current PDU session and the user equipment from the unified data management function.
  • the home session management function obtains policy data related to the current PDU session from the home policy control function.
  • the home session management function sends an N4 session establishment request message to the home user plane function.
  • the home plane user plane function returns an N4 session establishment response message to the home session management function.
  • the home session management function verifies the validity of the access token, such as using the public key of the network warehouse function to verify the signature or the shared key to verify the MAC value for verification. If the verification is passed, it means that the visited session management function is allowed to access the resource, and the home session management function sends a session establishment response message to the visited session management function.
  • the visited session management function sends an N1N2 message to the access and mobility management function, where the message is used to send PDU session-related information to the base station and user equipment.
  • the access and mobility management function sends a PDU session establishment request message to the base station, and sends data packet forwarding information of the visited user plane function to the base station.
  • the base station replies to the access and mobility management function with a PDU session establishment response, and the message carries data packet forwarding information of the base station.
  • the access and mobility management function sends a PDU session update request message to the visited session management function, where the message carries information obtained from the base station.
  • the visitor session management function notifies the visitor site user plane function establishment and the service data packet forwarding channel of the base station.
  • the visited session management function returns a PDU session update response to the access and mobility management function.
  • the foregoing service authorization information includes the resource identifier of the second server. Therefore, as shown in FIG. 11, the S803 first server obtains the access token according to the service authorization information, which may include S1101-S1104, which are divided into the following two stages: a network function discovery stage and an access token request stage, which are described below.
  • the above network function discovery stage may include S1101-S1102:
  • the first server sends a network function discovery request message to the authorization server.
  • the network function discovery request message carries the host name of the second server; the host name of the second server is part of the resource identifier of the second server.
  • the resource identifier of the second server is in the following format:
  • the host name of the second server may be the apiRoot field, or the authority / host field in the apiRoot field.
  • the authorization server may determine the instance identifier of the second server according to the host name of the second server, and then send a network function discovery response message to the first server.
  • the network function discovery response message carries the instance identifier of the second server.
  • the second server when the second server registers with the authorization server, it will carry information such as the host name of the second server and the instance identifier of the second server.
  • the authorization server receives and stores the host name of the second server and the instance identifier of the second server. After receiving the network function discovery request message, the authorization server may determine the instance identifier of the second server according to the host name of the second server carried in the network function discovery request message.
  • the first server receives the network function discovery response message sent by the authorization server.
  • the network function discovery response message carries the instance identifier of the second server.
  • the above access token request stage may include S1103-S1104:
  • the first server sends an access token request message to the authorization server.
  • the access token request message carries the instance identifier of the second server.
  • the access token request message may also carry the instance identifier of the second server and a list of desired service names.
  • the authorization server After the authorization server receives the above access token request message, the authorization server determines to allow the first server to access the resources of the second server, and the corresponding desired service name list, generates an access token, and sends the access token to the first server Response message.
  • the access token response message carries the access token.
  • the first server receives the access token response message sent by the authorization server.
  • the access token response message carries the access token, and the access token is generated by the authorization server according to the instance identifier of the second server.
  • the above access token may also include an instance ID of the authorization server, an instance ID of the first server, an instance ID of the second server and a list of service names, and an expiration time of the access token.
  • the access and mobility management function is a client
  • the visiting session management function is a first server
  • the home session management function is a second server
  • the network warehouse function is an authorization server.
  • the service authorization method shown in FIG. 12 may be specifically implemented as S1201-S1220:
  • S1201 The user equipment sends a PDU session establishment request message to the access and mobility management functions through the base station.
  • the access and mobility management functions select the visited session management function and the home session management function.
  • the access and mobility management functions can select appropriate session management functions through the network warehouse function.
  • the access and mobility management function sends a session management context establishment request message to the visited session management function.
  • the request message for establishing a session management context carries the resource identifier of the home session management function.
  • the visited session management function replies to the access and mobility management function to establish a session management context response message.
  • the request message for establishing a session management context carries the instance identifier of the home session management function.
  • the visiting session management function selects the user plane function, and sends an N4 session establishment request message to the user plane function.
  • the visited session management function needs to access the resources of the home session management corresponding to the resource identifier of the home session management function carried in the establishment session management context request message.
  • the visiting session management function can obtain the access token for accessing the home session management function through the network warehouse function.
  • the access tokens generated using the above access token generation method 1 are the access tokens generated using the above access token generation method 1:
  • Access token generation method 1
  • the visited session management function obtains the host name of the home session management function by establishing the session management context request message carrying the resource identifier of the home session management function, and sends a network function discovery request message to the network warehouse function.
  • the host name of the home session management function is a part of the resource identifier of the home session management function.
  • the resource identifier of the home session management function is shown in the following format.
  • the host name of the home session management function can be apiRoot or authority / host in apiRoot.
  • the network function discovery request message carries the host name of the home session management function.
  • the network warehouse function determines the instance identifier of the home session management function according to the host name of the home session management function, and replies to the network session discovery response message to the visited session management function.
  • the network function discovery response message carries the instance identifier of the home session management function.
  • the home session management function information when registering the home session management function with the network warehouse function, the home session management function information is carried, and the home session management function information includes information such as the host name of the home session management function and the instance identification of the home session management function.
  • the network warehouse function receives and stores the above information of the home session management function, and determines the instance identifier of the home session management function in the home session management function information according to the host name of the home session management function carried in the network function discovery request message .
  • the session management function of the visited place sends an access token request message to the network warehouse function.
  • the access token request message carries the instance identifier of the visited session management function, the instance identifier of the attributable session management function, and a list of desired service names.
  • the network warehouse function determines the resources authorized to access the home session management function according to the information carried in the access token request message, generates an access token, and sends an access token response message to the visited session management function.
  • the network warehouse function determines resources authorized to access the session management function of the home location to generate the access token, including:
  • the network warehouse function determines that the visiting session management function is allowed to access the home session management function and the desired service name list, the network warehouse function generates an access token.
  • the access token contains the instance ID of the network warehouse function, the instance ID of the session management function in the visited place, the instance ID and service name list of the session management function in the home place, and the expiration time of the access token.
  • the visitor session management function determines that the service name of the home session management function that needs to be called is included in the service name list of the home session management function in the above access token, the visitor session management function transfers to the home session management The home session management function corresponding to the resource identifier of the function sends a session establishment request message. Among them, the session establishment request message carries the access token.
  • the home session management function obtains the session management subscription data corresponding to the current PDU session / user equipment from the unified data management function.
  • the home session management function obtains policy data related to the current PDU session from the home policy control function.
  • the home session management function selects the home user plane function and sends an N4 session establishment request message to the home user plane function.
  • the home user plane function sends an N4 session establishment response message to the home session management function.
  • the home session management function verifies the validity of the access token, such as using the public key of the network warehouse function to verify the signature or the shared key to verify the MAC value. If the verification passes, it means that the visiting session management function is allowed to access this service, and the home session management function sends a session establishment response message to the visiting session management function.
  • the visited session management function sends an N1N2 message to the access and mobility management function, where the message is used to send PDU session-related information to the base station and user equipment.
  • the access and mobility management function sends a PDU session establishment request message to the base station, and sends data packet forwarding information of the visited user plane function to the base station.
  • RRC Radio Resource Control
  • the base station replies to the access and mobility management function with a PDU session establishment response.
  • the message carries data packet forwarding information of the base station.
  • the access and mobility management function sends a PDU session update request message to the visited session management function, where the message carries information obtained from the base station.
  • the visited site session management function notifies the visited site user plane function establishment and the base station's service data packet forwarding channel.
  • the visited session management function returns a PDU session update response to the access and mobility management function.
  • the foregoing service authorization information includes the resource identifier of the second server.
  • the resource identifier of the second server includes the host name of the second server.
  • the host name of the second server can also be directly sent to the authorization server, and the After obtaining the instance identifier of the second server, the authorization server directly generates an access token. That is to say, the access token can also be generated by the above-mentioned second token generation method. Therefore, as shown in FIG. 13, the S803 first server obtains the access token according to the service authorization information, which may also include S1301-S1302:
  • S1301 The first server sends an access token request message to the authorization server.
  • the access token request message carries the host name of the second server; the host name of the second server is part of the resource identifier of the second server.
  • the access token request message may also carry the instance identifier of the first server and a list of desired service names.
  • the authorization server may obtain the instance identifier of the second server according to the host name of the second server carried in the access token request message, and generate the access token according to the instance identifier of the second server.
  • the authorization server may send an access token response message to the first server.
  • the access token response message carries the access token.
  • the first server receives the access token response message sent by the authorization server.
  • the access token response message carries the access token, and the access token is generated by the authorization server according to the host name of the second server.
  • the above access token includes the instance ID of the authorization server, the instance ID of the first server, the instance ID of the second server and the list of service names, and the expiration time of the access token.
  • the access and mobility management function is a client
  • the visiting session management function is a first server
  • the home session management function is a second server
  • the network warehouse function is an authorization server.
  • the service authorization method shown in FIG. 13 may be specifically implemented as: S1401-S1404B, and S1407B-S1420.
  • S1401-S1404B can refer to the relevant descriptions of S1201-S1204B
  • S1409-S1420 can refer to the relevant descriptions of S1209-S1220, which will not be repeated here.
  • the service authorization method shown in FIG. 14 does not include the network function discovery phase, but only includes the access token request phase, that is, S1407B and S1408B:
  • the visited session management function sends an access token request message to the network warehouse function.
  • the access token request message carries the instance identifier and network function type of the visited session management function, the host name of the session management function and the desired service name list.
  • the network warehouse function determines the resources authorized to access the home session management function according to the information carried in the access token request message in S1407B, generates an access token, and sends an access token response message to the visited session management function.
  • the network warehouse function determines the instance identifier of the home session management function according to the host name of the home session management function (the determination method can refer to the access token generation method 1), and determines the instance ID corresponding to the authorized access to the home session management function Attribution of resources for session management functions.
  • the access token is a JSON Web token, such as an access token that uses JSON Web signature (JSON Web signature (JWS)).
  • JSON Web signature JWS
  • the JSON Web signature can be a digital signature or message authentication codes (message authentication codes, MACs).
  • the resource identifier of the home session management function is a uniform resource identifier, and the instance ID of the visit session management function and the home session session function may be the instance ID of the network function in UUID format.
  • the first server sends a second service request message to the second server.
  • the first server receives the second service response message sent by the second server.
  • the second service request message carries an access token.
  • the first server only needs to apply for the access token of the second server for itself. Therefore, the access token applied for by the first server for itself may not include the instance identifier of the client.
  • the service authorization information may also include a service name that the first server needs to access. Therefore, optionally, when the service authorization information includes an instance identifier of the second server, or the service authorization information includes a resource identifier of the second server, the service authorization information may further include the service name of the second server.
  • the service name of the second server is the service name that the first server needs to access.
  • the service name of the second server is used by the first server to determine a desired service name list, so that the first server carries the desired service name list when sending an access token request to the authorization server.
  • the first server applies for its service authorization to access the second server according to the service authorization information carried in the first service request message sent by the client, and accesses the The second server can solve the problem that the first server accesses the second server without service authorization in the scenario where the second server is discovered by the client, so as to reduce the security risk of the serviced network.
  • FIG. 15 is a schematic structural diagram of a communication device according to an embodiment of the present application.
  • the communication device can be applied to the system shown in FIG. 1 to perform the functions of the client in the above method embodiments.
  • FIG. 15 shows only the main components of the communication device.
  • the communication device 1500 includes: a sending module 1501.
  • the sending module 1501 is configured to send the first service request message to the first server.
  • the first service request message carries service authorization information; the service authorization information is used when the first server accesses the second server.
  • the above-mentioned service authorization information includes an access token.
  • the communication device 1500 further includes: a receiving module 1502.
  • the foregoing sending module 1501 is also used to send an access token request message to the authorization server before the sending module 1501 sends the first service request message to the first server.
  • the access token request message carries the instance identifier of the communication device and the instance identifier of the first server.
  • the receiving module 1502 is used to receive the access token response message sent by the authorization server.
  • the access token response message carries the access token.
  • the sending module 1501 is also used to send a first service request message to the first server.
  • the first service request message includes an access token.
  • the access token includes the instance identifier of the first server.
  • the access token includes the instance identifier of the communication device and the instance identifier of the first server.
  • the access token request message also carries the network function type of the communication device and / or the network function type of the first server.
  • the above access token may further include an access token expiration time.
  • the communication device 1500 may further include: a processing module 1503.
  • the processing module 1503 is used to control the sending module 1501 and the receiving module 1502 to apply for a new access token from the authorization server and control the sending module 1501 to access the new The token informs the first server.
  • the above service authorization information may further include the service name of the second server; the service name of the second server is The service name that the first server needs to access.
  • the communication device 1500 may further include a storage module for storing instructions and data of the communication device 1500.
  • the communication device 1500 may be the above client, or may be a chip system provided in the above client, which is not limited in this application.
  • FIG. 18 is a schematic structural diagram of another communication device provided by an embodiment of the present application.
  • the communication device can be applied to the communication system shown in FIG. 1 and performs the function of the first server in the above method embodiment.
  • FIG. 18 shows only the main components of the communication device.
  • the communication device 1800 includes a receiving module 1801, a sending module 1802, and an acquiring module 1803.
  • the receiving module 1801 is configured to receive the first service request message sent by the client.
  • the first service request message carries service authorization information.
  • the obtaining module 1803 is used to obtain an access token according to service authorization information.
  • the access token is used when the communication device 1800 accesses the second server.
  • the sending module 1802 is configured to send a second service request message to the second server.
  • the second service request message carries an access token.
  • the foregoing service authorization information includes an instance identifier of the second server.
  • the sending module 1802 is also used to send an access token request message to the authorization server.
  • the access token request message carries the instance identifier of the second server.
  • the receiving module 1801 is also used to receive the access token response message sent by the authorization server.
  • the access token response message carries an access token
  • the access token is generated by the authorization server according to the instance identifier of the second server.
  • the above service authorization information includes the resource identifier of the second server.
  • the sending module 1802 is also used to send a network function discovery request message to the authorization server.
  • the network function discovery request message carries the host name of the second server; the host name of the second server is part of the resource identifier of the second server.
  • the receiving module 1801 is also used to receive the network function discovery response message sent by the authorization server.
  • the network function discovery response message carries the instance identifier of the second server.
  • the sending module 1802 is also used to send an access token request message to the authorization server.
  • the access token request message carries the instance identifier of the second server.
  • the receiving module 1801 is also used to receive the access token response message sent by the authorization server.
  • the access token response message carries the access token, and the access token is generated by the authorization server according to the instance identifier of the second server.
  • the foregoing service authorization information includes the resource identifier of the second server.
  • the sending module 1802 is also used to send an access token request message to the authorization server.
  • the access token request message carries the host name of the second server; the host name of the second server is part of the resource identifier of the second server.
  • the receiving module 1801 is also used to receive the access token response message sent by the authorization server.
  • the access token response message carries the access token, and the access token is generated by the authorization server according to the host name of the second server.
  • the access token applied by the first server by itself includes the instance identifier of the second server.
  • the communication device 1800 may further include a storage module for storing instructions and data of the communication device 1500.
  • the communication device 1800 may be the foregoing first server, or may be a chip system provided in the foregoing first server, which is not limited in this application.
  • FIG. 19 is a schematic structural diagram of yet another communication device provided by an embodiment of the present application.
  • the communication device may be applicable to the communication system shown in FIG. 1 and execute the function of the client in the above method embodiment or the function of the first server in the above method embodiment.
  • FIG. 19 shows only the main components of the communication device.
  • the communication device 1900 includes a processor 1901 and a transceiver 1902.
  • the processor 1901 is coupled to the memory 1903, for example, the processor 1901 is connected to the memory 1903 through the bus 1904; the processor 1901 is used to execute the computer program stored in the memory 1903, so that the communication device 1900 executes the client as in the above method embodiment Function of the terminal, or perform the function of the first server as in the above method embodiment.
  • the communication device 1900 may be the client or the first server, or may be a chip system installed in the client or the first server, which is not limited in this application.
  • An embodiment of the present application provides a communication system.
  • the communication system includes the client and the first server, and the authorization server and the second server.
  • Embodiments of the present application provide a computer-readable storage medium that stores a program or an instruction.
  • the program or the instruction runs on the computer, the computer is allowed to execute the service authorization method described in the foregoing method embodiments.
  • An embodiment of the present application provides a computer program product, including: computer program code; when the computer program code runs on a computer, the computer is allowed to execute the service authorization method described in the foregoing method embodiments.
  • the processor in the embodiments of the present application may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSPs), and dedicated integration Circuit (application specific integrated circuit, ASIC), ready-made programmable gate array (field programmable gate array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • the general-purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
  • the memory in the embodiments of the present application may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory.
  • the non-volatile memory can be read-only memory (read-only memory, ROM), programmable read-only memory (programmable ROM, PROM), erasable programmable read-only memory (erasable PROM, EPROM), electronically Erasable programmable read-only memory (electrically EPROM, EEPROM) or flash memory.
  • the volatile memory may be a random access memory (random access memory, RAM), which is used as an external cache.
  • random access memory random access memory
  • static random access memory static random access memory
  • DRAM dynamic random access memory
  • DRAM synchronous dynamic random access Access memory
  • SDRAM double data rate synchronous dynamic random access memory
  • double data Srate double data Srate
  • DDR SDRAM enhanced synchronous dynamic random access memory
  • ESDRAM synchronous connection dynamic random access memory Take memory (synchlink DRAM, SLDRAM) and direct memory bus random access memory (direct rambus RAM, DR RAM).
  • the above embodiments can be implemented in whole or in part by software, hardware (such as a circuit), firmware, or any other combination.
  • the above-described embodiments may be implemented in whole or in part in the form of computer program products.
  • the computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the processes or functions according to the embodiments of the present application are generated in whole or in part.
  • the computer may be a general-purpose computer, a dedicated computer, a computer network, or other programmable devices.
  • the computer instructions may be stored in a computer-readable storage medium or transferred from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be from a website site, computer, server or data center Transmit to another website, computer, server or data center by wired (such as infrared, wireless, microwave, etc.).
  • the computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or data center that contains one or more collections of available media.
  • the usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium.
  • the semiconductor medium may be a solid state drive.
  • At least one refers to one or more, and “multiple” refers to two or more.
  • At least one of the following or a similar expression refers to any combination of these items, including any combination of a single item or a plurality of items.
  • at least one item (a) in a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, c can be a single or multiple .
  • the disclosed system, device, and method may be implemented in other ways.
  • the device embodiments described above are only schematic.
  • the division of the units is only a division of logical functions.
  • there may be other divisions for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
  • 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, they may be located in one place, or may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium.
  • the technical solution of the present application essentially or part of the contribution to the existing technology or part of the technical solution can be embodied in the form of a software product, the computer software product is stored in a storage medium, including Several instructions are used to enable a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in the embodiments of the present application.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM), random access memory (random access memory, RAM), magnetic disk or optical disk and other media that can store program codes .

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)

Abstract

本申请的实施例公开一种服务授权方法及通信装置,能够解决第二服务器由客户端发现的场景下,第一服务器访问第二服务器未获服务授权的问题,以降低服务化网络的安全风险。该方法包括:由客户端代为申请第一服务器访问第二服务器的访问令牌,并通知第一服务器。或者,第一服务器根据客户端提供的第二服务器的实例标识或资源标识,由第一服务器自行申请上述访问令牌。

Description

服务授权方法及通信装置
本申请要求于2018年10月29日提交国家知识产权局、申请号为201811268836.4、申请名称为“服务授权方法及通信装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及通信领域,尤其涉及一种服务授权方法及通信装置。
背景技术
在采用服务化架构(service-based architecture,SBA)部署的网络,如第五代(5th generation,5G)移动通信系统的核心网(core network,CN)中,不同的网络功能通常基于客户端(client)/服务器(server)的通信模式进行通信。请求方为客户端,响应方为服务器。为了避免任意客户端访问服务器,给移动通信系统带来安全风险,同时也为了支持第三方客户端的资源受限访问,服务化架构还支持服务授权功能。具体地,服务器可包括授权服务器(authority server)和功能服务器(function server)。客户端向授权服务器申请客户端访问功能服务器的授权信息,如访问令牌(access token),然后客户端根据申请到的授权信息访问功能服务器,功能服务器根据授权信息执行对客户端的访问授权。
然而,在上述场景中,只考虑了如何授权客户端访问功能服务器,其中功能服务器是由客户端发现的。在功能服务器A访问功能服务器B,且功能服务器B是由客户端发现的场景下,并没有考虑如何授权功能服务器A访问功能服务器B。也就是说,功能服务器A是在没有授权的情况下访问功能服务器B的,存在较高的网络安全风险。
发明内容
本申请的实施例提供一种服务授权方法及通信装置,能够解决第二服务器由客户端发现的场景下,第一服务器访问第二服务器未获服务授权的问题。
为达到上述目的,本申请的实施例提供如下技术方案:
第一方面,提供一种服务授权方法,包括:客户端向第一服务器发送第一服务请求消息。其中,第一服务请求消息携带服务授权信息;该服务授权信息为第一服务器访问第二服务器时使用。
本申请实施例提供的服务授权方法,在客户端向第一服务器发送的第一服务请求消息中携带第一服务器访问第二服务器的服务授权信息,以便第一服务器根据上述服务授权信息访问第二服务器,可以解决第二服务器由客户端发现的场景下,第一服务器访问第二服务器未获服务授权的问题,以降低服务化网络的安全风险。
示例性地,可以通过如下两种方式获得第一服务器访问第二服务器的服务授权。
服务授权方式一
具体地,可由客户端代为申请上述服务授权,并通知第一服务器。例如,客户端 代为申请第一服务器访问第二服务器的访问令牌,并将访问令牌发送给第一服务器。
服务授权方式二
具体地,可由客户端将第二服务器的相关信息发送给第一服务器,然后由第一服务器自行申请上述服务授权。例如,客户端可将第二服务器的实例标识或资源标识发送给第一服务器,然后由第一服务器根据第二服务器的实例标识或资源标识自行申请访问第二服务器的访问令牌。
需要说明的是,上述服务授权信息可以是访问令牌,如JSON Web令牌,也可以是其他形式的服务访问授权信息,本申请对此不做限定。
下面就以访问令牌为例,分别描述服务授权方式一和服务授权方式二的技术方案。
服务授权方式一
在一种可能的设计方法中,上述服务授权信息包括访问令牌。可以理解,在客户端向第一服务器发送第一服务请求消息之前,上述服务授权方法还可以包括:客户端向授权服务器发送访问令牌请求消息。其中,访问令牌请求消息携带客户端的实例标识和第一服务器的实例标识。然后,客户端接收授权服务器发送的访问令牌响应消息。其中,访问令牌响应消息携带上述访问令牌。
相应地,客户端向第一服务器发送第一服务请求消息,可以包括:客户端向第一服务器发送第一服务请求消息;其中,第一服务请求消息包括上述访问令牌。其中,客户端为第二服务器的访问令牌请求方,第一服务器为第二服务器的服务请求方。因此,上述访问令牌需要包括第一服务器的实例标识。
可以理解,若客户端不需要访问第二服务器,即客户端不是第二服务器的服务请求方,客户端只需要为第一服务器申请访问令牌,而不需要为自己申请访问令牌。在此情况下,上述访问令牌可以不包括客户端的实例标识。
可选地,若客户端需要访问第二服务器,也就是说:客户端既是第二服务器的访问令牌请求方,也是第二服务器的服务请求方,则客户端需要为自己和第一服务器都申请访问第二服务器的访问令牌。在此情况下,上述访问令牌可以包括客户端的实例标识和第一服务器的实例标识。
可选地,上述访问令牌请求消息还可以携带客户端的网络功能类型和第一服务器的网络功能类型,以便授权服务器根据客户端的网络功能类型和第一服务器的网络功能类型确定是否授权第一服务器访问第二服务器。
相应地,上述访问令牌还可以包括上述客户端和/或第一服务器可访问的服务器的服务器实例列表和服务名称列表。
可选地,若上述服务器实例列表包括第二服务器的实例标识,且上述服务名称列表包括第二服务器的服务名称,则上述服务授权信息可以包括上述访问令牌。
可选地,上述访问令牌还可以包括授权服务器的实例标识。
为了进一步提高访问第二服务器的安全性,还可以为上述访问令牌设定有效期。有鉴于此,上述访问令牌还可以包括访问令牌过期时间。相应地,上述服务授权方法还可以包括:若客户端通过访问令牌过期时间确定访问令牌已过期,则客户端向授权服务器申请新的访问令牌,并将新的访问令牌通知第一服务器。
服务授权方式二
在本申请中,鉴于第二服务器是由客户端发现的,在另一种可能的设计方法中,也可以由客户端为第一服务器提供第二服务器的信息,如第二服务器的实例标识,或者第二服务器的资源标识,以便第一服务器根据第二服务器的上述信息自行向授权服务器申请服务访问权限,如申请访问令牌。
为了进一步提高申请访问令牌的准确性,除上述第二服务器的实例标识或资源标识外,上述服务授权信息还可以包括第一服务器需要访问的服务名称。因此,可选地,当上述服务授权信息包括第二服务器的实例标识,或者上述服务授权信息包括第二服务器的资源标识时,上述服务授权信息还可以包括第二服务器的服务名称。其中,第二服务器的服务名称为第一服务器需要访问的服务名称。
需要说明的是,对于服务授权方式二,访问令牌是由第一服务器自行申请的,其技术方案细节可以参考下述第二方面中的相关描述,此处不再赘述。
第二方面,还提供一种服务授权方法,包括:第一服务器接收客户端发送的第一服务请求消息。其中,第一服务请求消息携带服务授权信息。然后,第一服务器根据服务授权信息获取访问令牌。其中,访问令牌为第一服务器访问第二服务器时使用。之后,第一服务器向第二服务器发送第二服务请求消息。其中,第二服务请求消息携带访问令牌。
本申请实施例提供的服务授权方法,在第一服务器根据客户端发送的第一服务请求消息中携带的服务授权信息,自行申请其访问第二服务器的服务授权,并根据申请的服务授权访问第二服务器,可以解决第二服务器由客户端发现的场景下,第一服务器访问第二服务器未获服务授权的问题,以降低服务化网络的安全风险。
需要说明的是,第二方面提供的服务授权方法,对应于上述服务授权方式二。
在一种可能的设计方法中,上述服务授权信息包括第二服务器的实例标识。因此,上述第一服务器根据服务授权信息获取访问令牌,可以包括:第一服务器向授权服务器发送访问令牌请求消息。其中,访问令牌请求消息携带第二服务器的实例标识。然后,第一服务器接收授权服务器发送的访问令牌响应消息。其中,访问令牌响应消息携带访问令牌,访问令牌由授权服务器根据第二服务器的实例标识生成。
在另一种可能的设计方法中,上述服务授权信息包括第二服务器的资源标识。因此,上述第一服务器根据服务授权信息获取访问令牌,可以包括如下两个阶段:网络功能发现阶段和访问令牌请求阶段。
其中,网络功能发现阶段可以包括:第一服务器向授权服务器发送网络功能发现请求消息。其中,网络功能发现请求消息携带第二服务器的主机名;第二服务器的主机名为第二服务器的资源标识的一部分。然后,第一服务器接收授权服务器发送的网络功能发现响应消息。其中,网络功能发现响应消息携带第二服务器的实例标识。
上述访问令牌请求阶段可以包括:第一服务器向授权服务器发送访问令牌请求消息。其中,访问令牌请求消息携带第二服务器的实例标识。然后,第一服务器接收授权服务器发送的访问令牌响应消息。其中,访问令牌响应消息携带访问令牌,访问令牌由授权服务器根据第二服务器的实例标识生成。
在又一种可能的设计方法中,上述服务授权信息包括第二服务器的资源标识。因此,上述第一服务器根据服务授权信息获取访问令牌,包括:第一服务器向授权服务 器发送访问令牌请求消息。其中,访问令牌请求消息携带第二服务器的主机名;第二服务器的主机名为第二服务器的资源标识的一部分。然后,第一服务器接收授权服务器发送的访问令牌响应消息。其中,访问令牌响应消息携带访问令牌,访问令牌由授权服务器根据第二服务器的主机名生成。
可选地,第一服务器自行申请的访问令牌包括第二服务器的实例标识。
具体地,第一服务器为自己申请的访问令牌可以包括:授权服务器的实例标识、第一服务器的实例标识、第二服务器的实例标识和服务名称列表,访问令牌过期时间;或者,
第一服务器为自己申请的访问令牌可以包括:包括:授权服务器的实例标识、第一服务器的实例标识、已授权服务器的实例标识列表和服务名称列表,访问令牌过期时间。其中,已授权服务器的实例标识列表包括第二服务器的实例标识,已授权服务器的服务名称列表包括第二服务器的服务名称。
需要说明的是,对于服务授权方式二,第一服务器只需要为自己申请访问第二服务器的访问令牌。因此,第一服务器为自己申请的访问令牌可以不包括客户端的实例标识。
其中,需要指出的是,在本发明提供的另一个实施例中,第一服务器接收客户端发送的第一服务请求消息;其中,所述第一服务请求消息携带访问令牌;
所述第一服务器向所述第二服务器发送第二服务请求消息;其中,所述第二服务请求消息携带所述访问令牌。
第三方面,提供一种通信装置,包括:发送模块。其中,发送模块,用于向第一服务器发送第一服务请求消息。其中,第一服务请求消息携带服务授权信息;服务授权信息为第一服务器访问第二服务器时使用。
在一种可能的设计中,上述服务授权信息包括访问令牌,第二方面所述的通信装置还包括:接收模块。
其中,上述发送模块,还用于在发送模块向第一服务器发送第一服务请求消息之前,向授权服务器发送访问令牌请求消息。其中,访问令牌请求消息携带通信装置的实例标识和第一服务器的实例标识。接收模块,用于接收授权服务器发送的访问令牌响应消息。其中,访问令牌响应消息携带访问令牌。发送模块,还用于向第一服务器发送第一服务请求消息。其中,第一服务请求消息包括访问令牌。其中,访问令牌包括第一服务器的实例标识。或者,访问令牌包括通信装置的实例标识和第一服务器的实例标识。
可选地,访问令牌请求消息还携带通信装置的网络功能类型和/或第一服务器的网络功能类型。
可选地,上述访问令牌还可以包括访问令牌过期时间,第三方面所述的通信装置还可以包括:处理模块。其中,处理模块,用于若通过访问令牌过期时间确定访问令牌已过期,则控制发送模块和接收模块向授权服务器申请新的访问令牌,并控制发送模块将新的访问令牌通知第一服务器。
可选地,当服务授权信息包括第二服务器的实例标识,或者服务授权信息包括第二服务器的资源标识时,服务授权信息还包括第二服务器的服务名称;第二服务器的 服务名称为第一服务器需要访问的服务名称。
需要说明的是,第三方面所述的通信装置可以是上述客户端,也可以是设置于上述客户端中的芯片系统,本申请对此不做限定。
第四方面,还提供一种通信装置,包括:接收模块、发送模块和获取模块。其中,接收模块,用于接收客户端发送的第一服务请求消息。其中,第一服务请求消息携带服务授权信息。获取模块,用于根据服务授权信息获取访问令牌。其中,访问令牌为通信装置访问第二服务器时使用。发送模块,用于向第二服务器发送第二服务请求消息。其中,第二服务请求消息携带访问令牌。
在一种可能的设计中,上述服务授权信息包括第二服务器的实例标识。相应地,发送模块,还用于向授权服务器发送访问令牌请求消息。其中,访问令牌请求消息携带第二服务器的实例标识。接收模块,还用于接收授权服务器发送的访问令牌响应消息。其中,访问令牌响应消息携带访问令牌,访问令牌由授权服务器根据第二服务器的实例标识生成。
在另一种可能的设计中,上述服务授权信息包括第二服务器的资源标识。相应地,发送模块,还用于向授权服务器发送网络功能发现请求消息。其中,网络功能发现请求消息携带第二服务器的主机名;第二服务器的主机名为第二服务器的资源标识的一部分。接收模块,还用于接收授权服务器发送的网络功能发现响应消息。其中,网络功能发现响应消息携带第二服务器的实例标识。发送模块,还用于向授权服务器发送访问令牌请求消息。其中,访问令牌请求消息携带第二服务器的实例标识。接收模块,还用于接收授权服务器发送的访问令牌响应消息。其中,访问令牌响应消息携带访问令牌,访问令牌由授权服务器根据第二服务器的实例标识生成。
在又一种可能的设计中,上述服务授权信息包括第二服务器的资源标识。相应地,发送模块,还用于向授权服务器发送访问令牌请求消息。其中,访问令牌请求消息携带第二服务器的主机名;第二服务器的主机名为第二服务器的资源标识的一部分。接收模块,还用于接收授权服务器发送的访问令牌响应消息。其中,访问令牌响应消息携带访问令牌,访问令牌由授权服务器根据第二服务器的主机名生成。
可选地,第一服务器自行申请的访问令牌包括第二服务器的实例标识。
需要说明的是,第四方面所述的通信装置可以是上述第一服务器,也可以是设置于上述第一服务器中的芯片系统,本申请对此不做限定。
第五方面,提供一种通信装置,包括:处理器和收发器。其中,处理器与存储器耦合;处理器用于执行存储器中存储的计算机程序,以使得该通信装置执行如第一方面及其各种可选的实现方式中任意之一所述的服务授权方法,或者执行如第二方面及其各种可选的实现方式中任意之一所述的服务授权方法。
需要说明的是,第五方面所述的通信装置可以是上述客户端或上述第一服务器,也可以是设置于上述客户端或第一服务器中的芯片系统,本申请对此不做限定。
第六方面,提供一种通信系统。该通信系统包括上述客户端和第一服务器,以及上述授权服务器和第二服务器。
第七方面,提供一种计算机可读存储介质,存储有程序或指令,当程序或指令在计算机上运行时,使得计算机执行如第一方面及其各种可选的实现方式中任意之一所 述的服务授权方法,或者执行如第二方面及其各种可选的实现方式中任意之一所述的服务授权方法。
第八方面,提供一种计算机程序产品,包括:计算机程序代码;当计算机程序代码在计算机上运行时,使得计算机执行如第一方面及其各种可选的实现方式中任意之一所述的服务授权方法,或者执行如第二方面及其各种可选的实现方式中任意之一所述的服务授权方法。
附图说明
图1为本申请实施例提供的服务授权方法所适用的通信系统的结构示意图;
图2为基于客户端/服务器模型的通信方法的流程示意图;
图3为基于客户端/服务器模型的通信方式一的通信方法的流程示意图;
图4A为基于客户端/服务器模型的通信方式二的通信方法的流程示意图一;
图4B为基于客户端/服务器模型的通信方式二的通信方法的流程示意图二;
图5为本申请实施例提供的基于服务授权方式一的服务授权方法的流程示意图一;
图6为本申请实施例提供的基于服务授权方式一的服务授权方法的流程示意图二;
图7为本申请实施例提供的基于服务授权方式一的服务授权方法的流程示意图三;
图8为本申请实施例提供的基于服务授权方式二的服务授权方法的流程示意图一;
图9为本申请实施例提供的基于服务授权方式二的服务授权方法的流程示意图二;
图10为本申请实施例提供的基于服务授权方式二的服务授权方法的流程示意图三;
图11为本申请实施例提供的基于服务授权方式二的服务授权方法的流程示意图四;
图12为本申请实施例提供的基于服务授权方式二的服务授权方法的流程示意图五;
图13为本申请实施例提供的基于服务授权方式二的服务授权方法的流程示意图六;
图14为本申请实施例提供的基于服务授权方式二的服务授权方法的流程示意图七;
图15为本申请实施例提供的一种通信装置的结构示意图一;
图16为本申请实施例提供的一种通信设备的结构示意图二;
图17为本申请实施例提供的一种通信装置的结构示意图三;
图18为本申请实施例提供的另一种通信设备的结构示意图;
图19为本申请实施例提供的又一种通信装置的结构示意图。
具体实施方式
下面将结合附图,对本申请中的技术方案进行描述。
本申请实施例的技术方案可以应用于各种通信系统,例如第五代(5th generation,5G)移动通信系统,及未来的通信系统,如6G系统等。
本申请将围绕可包括多个设备、组件、模块等的系统来呈现各个方面、实施例或特征。应当理解和明白的是,各个系统可以包括另外的设备、组件、模块等,并且/或者可以并不包括结合附图讨论的所有设备、组件、模块等。此外,还可以使用这些 方案的组合。
另外,在本申请实施例中,“示例地”、“例如”等词用于表示作例子、例证或说明。本申请中被描述为“示例”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用示例的一词旨在以具体方式呈现概念。
本申请实施例中,“信息(information)”,“信号(signal)”,“消息(message)”,“信道(channel)”、“信令(singalling)”有时可以混用,应当指出的是,在不强调其区别时,其所要表达的含义是一致的。“的(of)”,“相应的(corresponding,relevant)”和“对应的(corresponding)”有时可以混用,应当指出的是,在不强调其区别时,其所要表达的含义是一致的。
本申请实施例中,有时候下标如W 1可能会笔误为非下标的形式如W1,在不强调其区别时,其所要表达的含义是一致的。
本申请实施例描述的网络架构以及业务场景是为了更加清楚的说明本申请实施例的技术方案,并不构成对于本申请实施例提供的技术方案的限定,本领域普通技术人员可知,随着网络架构的演变和新业务场景的出现,本申请实施例提供的技术方案对于类似的技术问题,同样适用。
本申请实施例中部分场景以5G系统中的场景为例进行说明。应当指出的是,本申请实施例中的方案还可以应用于其他移动通信系统中,相应的名称也可以用其他移动通信系统中的对应功能的名称进行替代。
为便于理解本申请实施例,首先以图1中示出的通信系统为例详细说明适用于本申请实施例的通信系统。
如图1所示,该通信系统包括用户设备(user equipment,UE)、无线接入网(radio access network,RAN),以及核心网(core network,CN)。用户设备可以通过基站等接入网设备接入无线接入网,并通过核心网与外部的数据网络(data network,DN)建立通信连接。核心网主要用于用户设备注册、安全认证、移动性管理、位置管理、会话管理,以及转发用户设备和外部的数据网络之间的数据包等。
上述无线接入网可以为下一代接入网(next generation access network,NG-AN)。上述核心网包括下述网络功能:会话管理功能(session management function,SMF)、接入和移动性管理功能(access and mobility management function,AMF)、用户面功能(user plane function,UPF)、统一数据管理(unified data management,UDM)、策略控制功能(policy control function,PCF)、鉴权服务功能(authentication server function,AUSF)、网络切片选择功能(network slice selection function,NSSF)、网络公开功能(network exposure function,NEF)、网络仓库功能(network repository function,NRF)和应用功能(application function,AF)等。
需要说明的是,上述核心网可以包括一台或多台核心网设备。其中,核心网设备可以是用于执行上述单一网络功能的网元,也可以是用于执行上述多个网络功能的网元。在一台核心网设备用于执行上述多个网络功能的情况下,该核心网设备可以包括一个或多个用于执行上述多个网络功能的功能模块,该功能模块可以是软件模块,也可以是软硬件模块,本申请实施例不做限定。
为便于描述,上述网络功能,以及用于执行上述网络功能的网元、设备、功能模 块,以及设置于上述网元、设备内部的芯片系统等,下文中统一称之为网络功能。
需要说明的是,上述通信系统的核心网可以采用服务化架构(service-based architecture,SBA)。也就是说,上述不同的网络功能之间可以基于客户端(client)-服务器(server)模式进行通信。其中,服务消费方称为客户端,服务提供方称为服务器。具体地,上述接入和移动性管理功能、会话管理功能、策略控制功能和统一数据管理功能等控制面网络功能可以采用服务化接口进行交互。例如,如图1所示,接入和移动性管理功能提供的服务化接口可以为Namf,会话管理功能提供的服务化接口可以为Nsmf,策略控制功能提供的服务化接口可以为Npcf,统一数据管理功能提供的服务化接口可以为Nudm等。
上述接入网设备为位于上述通信系统网络侧,且具有无线收发功能的设备或可设置于该设备的芯片。该接入网设备包括但不限于:演进型节点B(evolved Node B,eNB)、无线网络控制器(radio network controller,RNC)、节点B(Node B,NB)、基站控制器(base station controller,BSC)、基站收发台(base transceiver station,BTS)、家庭基站(例如,home evolved NodeB,或home Node B,HNB)、基带单元(baseband unit,BBU),无线保真(wireless fidelity,WIFI)系统中的接入点(access point,AP)、无线中继节点、无线回传节点、传输点(transmission and reception point,TRP或者transmission point,TP)等,还可以为5G,如,新空口(new radio,NR)系统中的gNB,或,传输点(TRP或TP),5G系统中的基站的一个或一组(包括多个天线面板)天线面板,或者,还可以为构成gNB或传输点的网络节点,如基带单元(BBU),或,分布式单元(distributed unit,DU)等。
上述用户设备为接入上述通信系统,且具有无线收发功能的终端设备或可设置于该终端设备的芯片。该用户设备也可以称为用户装置、接入终端、用户单元、用户站、移动站、移动台、远方站、远程终端、移动设备、用户终端、终端、无线通信设备、用户代理或用户装置。本申请的实施例中的终端设备可以是手机(mobile phone)、平板电脑(Pad)、带无线收发功能的电脑、虚拟现实(virtual reality,VR)终端设备、增强现实(augmented reality,AR)终端设备、工业控制(industrial control)中的无线终端、无人驾驶(self driving)中的无线终端、远程医疗(remote medical)中的无线终端、智能电网(smart grid)中的无线终端、运输安全(transportation safety)中的无线终端、智慧城市(smart city)中的无线终端、智慧家庭(smart home)中的无线终端等。
应理解,图1仅为便于理解而示例的简化示意图,该通信系统中还可以包括其他网络设备或者还可以包括其他终端设备,图1中未予以画出。
为了降低上述通信系统的安全风险,上述网络仓库功能除了提供网络功能的注册功能和发现功能外,还集成了OAuth2.0授权服务器的功能。
图2示出了基于上述OAuth2.0授权服务机制的通信方法的流程示意图。如图2所示,基于上述OAuth2.0授权服务机制的通信方法通常可以包括S201-S204:
S201、客户端向授权服务器申请访问服务器的访问令牌。
S202、授权服务器对客户端进行鉴权,对于鉴权通过的客户端,分配访问令牌。
S203、客户端向服务器发送服务请求,以便访问服务器提供的资源。
其中,服务请求中携带S202中获得的访问令牌。
S204、服务器确定访问令牌的有效性,如果有效则允许客户端访问自身的资源,回复服务响应消息。
具体地,在应用了OAuth2.0授权服务机制的5G通信系统,如图1所示的通信系统中,可以存在如下两种通信方式的通信方法,下面分别说明。
通信方式一
图3示出了基于OAuth2.0授权服务机制的通信方式一的通信方法的流程示意图。如图3所示,该通信方法包括S301-S306:
S301、第一客户端发送网络功能发现请求消息给网络仓库功能,所述网络功能发现请求消息中携带目标网络功能类型、服务名称列表和第一客户端的网络功能类型等信息。
S302、网络仓库功能根据网络功能发现请求消息,将符合请求条件的服务器列表返回给第一客户端。其中,所述服务器列表包含一个或者多个服务器的信息,所述服务器信息包含服务器的实例标识和网络功能类型等。第一客户端可以在服务器列表中选择一个目标服务器,如第二服务器访问。例如,可以基于负荷均衡、优先级等原则选择目标服务器。
S303、第一客户端访问第一服务器提供的资源,发送第一服务请求消息给第一服务器。其中,第一服务请求消息中携带第二服务器的资源标识。其中,所述第二服务器的资源标识可以为第二服务器的统一资源标识符(uniform resource identifier,URI),所述第二服务器的资源标识可以由第一客户端根据步骤2获得的第二服务器信息生成。
S304、第一服务器回复第一服务请求响应消息。其中,第一服务请求响应消息携带第一客户端请求的资源。
S305、第一服务器同时作为第二客户端,根据第二服务器的资源标识向第二服务器发送第二服务请求消息。其中,第二服务请求消息用于请求访问第二服务器提供的资源;
S306、第二服务器返回第二服务响应消息。其中,第二服务请求响应消息携带第一服务器请求的资源。
通信方式二
图4A示出了基于OAuth2.0授权服务机制的通信方式二的一种通信方法的流程示意图。图4A所示的通信方式二为5G系统中的订阅/通知(subscribe/notify)模式,客户端作为服务消费者,服务器作为服务提供者,服务消费者订阅服务提供者上发生的网络事件,当该网络事件触发时,服务提供者发送事件通知消息给服务消费者。
如图4A所示,该通信方法包括S401-S404:
S401、第一客户端发送订阅请求消息给第一服务器。其中,订阅请求消息中携带订阅事件和第二服务器的资源标识,所述第二服务器的资源标识为第二服务器的统一资源标识符。
S402、第一服务器回复订阅响应。
S403、当上述订阅事件被触发,第一服务器同时作为第二客户端,根据第二服务器的资源标识,向第二服务器发送事件通知。
S404、第二服务器,回复事件通知响应。
在上述通信方式中,第一客户端同时作为第二服务器。
图4B示出了基于OAuth2.0授权服务机制的通信方式二的另一种通信方法的流程示意图。图4B与图4A的区别在于:图4B中第二服务器为另一个网络功能,并不是第一客户端。
上述两种通信方式的共同之处在于:第二客户端作为第一服务器,通过第一客户端提供的第二服务器的资源标识,访问第二服务器提供的资源。然而,第二客户端在访问第二服务器的过程中,并没有获得第二服务器的服务授权。也就是说,第二客户端是在未获服务授权的情况下访问第二服务器的,存在较高的网络安全风险。因此,如何在第二服务器由第一客户端发现的场景下,实现第一服务器作为第二客户端访问第二服务器的服务授权,成为一个亟待解决的问题。
为方便描述,下文中将“第一客户端”称为“客户端”,将“第一服务器”和“第二客户端”统称为“第一服务器”。
在本申请中,鉴于第二服务器是由客户端发现的,可以通过如下两种服务授权方式之一获得第一服务器访问第二服务器的服务授权。
服务授权方式一
具体地,可由客户端代为申请第一服务器访问第二访问的访问权限,并通知第一服务器。例如,客户端可以代为申请第一服务器访问第二服务器的访问令牌,并将访问令牌发送给第一服务器。
服务授权方式二
具体地,可由客户端将第二服务器的相关信息发送给第一服务器,然后由第一服务器自行申请访问第二服务器的访问权限。例如,客户端可将第二服务器的实例标识或资源标识发送给第一服务器,然后由第一服务器根据第二服务器的实例标识或资源标识自行申请访问第二服务器的访问令牌。
需要说明的是,上述第一服务器访问第二服务器的访问权限可以是访问令牌,如JSON Web令牌,也可以是其他形式的访问权限,本申请对此不做限定。
下面结合附图,分别描述服务授权方式一和服务授权方式二的技术方案。
服务授权方式一
图5示出了本申请实施例提供的一种基于服务授权方式一的服务授权方法的流程示意图,以适用于图1所示的通信系统中不同网络功能之间的通信。如图5所示,该服务授权方法包括S501-S504:
S501、客户端向第一服务器发送第一服务请求消息。
S502、客户端接收第一服务器发送的第一服务响应消息。
其中,第一服务请求消息携带服务授权信息。该服务授权信息为第一服务器访问第二服务器时使用。
上述服务授权信息可以包括访问令牌。其中,访问令牌可以是客户端事先代为申请的,也可以是除客户端和第一服务器之外的其他网络功能申请后发送给客户端,再由客户端转发给第一服务器的,本申请对此不做限定。
在一种可能的方法中,假定访问令牌是由客户端代为申请的,则如图6所示,在 执行S501客户端向第一服务器发送第一服务请求消息之前,上述基于服务授权方式一的服务授权方法还可以包括S601-S602:
S601、客户端向授权服务器发送访问令牌请求消息。
其中,访问令牌请求消息携带客户端的实例标识和第一服务器的实例标识。
S602、客户端接收授权服务器发送的访问令牌响应消息。其中,访问令牌响应消息携带访问令牌。
在S601-S602中,客户端为该访问令牌的申请者,因此,上述访问令牌请求消息需要携带客户端的实例标识,以便授权服务器将生成的访问令牌发送给访问令牌申请者,并由访问令牌申请者通知访问令牌使用者。
相应地,鉴于该访问令牌是为第一服务器申请的。因此,上述访问令牌请求消息还需要包括第一服务器的实例标识。
可以理解,若客户端不需要访问第二服务器,即客户端不是第二服务器的服务消费者,则客户端只需要为第一服务器申请访问令牌,而不需要为自己申请访问令牌。在此情况下,客户端在访问令牌请求消息中将客户端的实例标识指示为访问令牌请求者的实例标识,将第一服务器的实例标识指示为服务消费者的实例标识。授权服务器分配访问令牌,上述访问令牌可以不包括客户端的实例标识。
可选地,若客户端也需要访问第二服务器,也就是说,客户端既是第二服务器的访问令牌请求者,也是第二服务器的服务消费者,则客户端就需要为自己和第一服务器都申请访问第二服务器的访问令牌。在此情况下,客户端在访问令牌请求消息中将客户端的实例标识和第一服务器的实例标识指示为服务消费者的实例标识。授权服务器分配访问令牌,上述访问令牌需要包括客户端的实例标识和第一服务器的实例标识。
实施方式一,上述访问令牌请求消息还可以携带客户端的网络功能类型和/或第一服务器的网络功能类型,第二服务器的网络功能类型和期望的服务名称列表,以便授权服务器根据客户端的网络功能类型和/或第一服务器的网络功能类型,第二服务器的网络功能类型和期望的服务名称列表,确定授权客户端和/或第一服务器访问所述网络功能类型的第二服务器,并生成访问令牌。所述访问令牌还包括第二服务器的网络功能类型和期望的服务名称列表。
实施方式二,上述访问令牌请求消息还可以携带第二服务器的实例标识和期望的服务名称列表。例如,期望的服务器的服务名称列表可以包括一个或者多个第二服务器的服务名称。以便授权服务器根据第二服务器的实例标识和期望的服务名称列表,确定授权客户端和/或第一服务器访问所述第二服务器的实例标识对应的第二服务器。因此,可选地,上述访问令牌还可以包括第二服务器的实例标识和服务名称列表。
可选地,上述两种实施方式中,访问令牌还可以包括授权服务器的实例标识,用于指示访问令牌的授权者的身份信息。
可选地,上述两种实施方式中,访问令牌还可以包括访问令牌过期时间,以便过期刷新访问令牌,增强网络的安全性。
与S601-S602相对应,S501客户端向第一服务器发送第一服务请求消息,可以具体实现为如下步骤:
客户端向第一服务器发送第一服务请求消息;其中,第一服务请求消息包括上述 访问令牌。
为了进一步降低访问第二服务器的安全风险,授权服务器还可以为上述访问令牌设定有效期。有鉴于此,上述访问令牌还可以包括访问令牌过期时间。相应地,上述服务授权方法还可以包括如下步骤:
若客户端通过访问令牌过期时间确定访问令牌已过期,则客户端向授权服务器申请新的访问令牌,并将新的访问令牌通知第一服务器。
S503、第一服务器向第二服务器发送第二服务请求消息,所述消息中携带访问令牌。
S504、第一服务器接收第二服务器发送的第二服务响应消息。
具体地,第一服务器将获得的访问令牌发送给第二服务器,第二服务器通过校验访问令牌的有效性,确定允许第一服务器访问其上的资源。
下面通过5G系统中的能力开放流程来具体说明图6所示的服务授权方法。其中,统一数据管理功能为客户端,接入和移动性管理功能为第一服务器,网络开放功能为第二服务器,网络仓库功能为授权服务器。
如图7所示,上述基于服务授权方式一的另一种服务授权方法包括S701-S712:
S701、应用功能向网络开放功能发送事件订阅请求消息。其中,事件订阅请求消息用于订阅一个或者多个网络事件,所述事件订阅请求消息中携带订阅事件和应用功能的资源标识等信息。
S702、网络开放功能向统一数据管理功能发送事件订阅请求消息。其中,事件订阅请求消息中携带网络开放功能的资源标识。
此外,事件订阅请求消息还可以携带网络功能类型。其中,网络功能类型为网络开放功能。
S703、统一数据管理功能向网络仓库功能发送访问令牌请求消息。
其中,访问令牌请求消息中携带统一数据管理功能的实例标识和网络功能类型、接入和移动性管理功能的实例标识和网络功能类型、期望的网络功能类型和期望的服务名称列表。其中,期望的网络功能类型为网络开放功能(从S702获得),期望的服务名称列表可以为通配符或者订阅/通知指示。
S704、网络仓库功能根据访问令牌请求消息中携带的信息,确定授权访问网络开放功能的资源,生成访问令牌,并向统一数据管理功能发送。
具体地,确定授权访问网络开放功能的资源,生成访问令牌,可以采用如下两种令牌生成方式之一完成:
令牌生成方式一
若访问令牌请求消息中携带统一数据管理功能的实例标识和网络功能类型为访问令牌请求者的实例标识和网络功能类型,且接入和移动性管理功能的实例标识和网络功能类型为服务消费者的实例标识和网络功能类型,则网络仓库功能确定允许统一数据管理功能请求访问令牌,并且允许接入和移动性管理功能访问网络开放功能的资源。
网络仓库功能生成访问令牌。其中,访问令牌包含网络仓库功能的实例标识,接入和移动性管理功能的实例标识,授权的网络功能类型和服务名称列表,访问令牌过期时间。其中授权的网络功能类型为网络开放功能。
令牌生成方式二
若访问令牌请求消息中统一数据管理功能的实例标识和网络功能类型、接入和移动性管理功能的实例标识和网络功能类型均为服务消费者的实例标识和网络功能类型,则网络仓库功能确定允许统一数据管理功能和接入和移动性管理功能访问网络开放功能提供的资源。
网络仓库功能生成访问令牌。其中,访问令牌包含网络仓库功能的实例标识,统一数据管理功能的实例标识,接入和移动性管理功能的实例标识,授权的网络功能类型和服务名称列表,访问令牌过期时间。其中授权的网络功能类型为网络开放功能。
需要说明的是,访问令牌可以为JSON Web令牌,如采用JSON Web签名(JSON web signature,JWS)的访问令牌。其中,JSON Web签名可以是数字签名或者消息认证代码(message suthentication codes,MACs)。
上述网络开放功能的资源标识可以为统一资源标识符。上述统一数据管理功能的实例标识、接入和移动性管理功能的实例标识、网络仓库功能的实例标识可以为采用通用唯一识别码(universally unique identifier,UUID)格式的网络功能的实例标识。
S705、若统一数据管理功能确定S704中返回的访问令牌中的服务名称列表为通配符或者订阅/通知指示,则统一数据管理功能向接入和移动性管理功能发送事件订阅请求消息。其中,事件订阅请求消息中携带网络开放功能的资源标识和访问令牌。
S706、接入和移动性管理功能向统一数据管理功能回复事件订阅响应。
S707、统一数据管理功能向网络开放功能回复事件订阅响应。
S708、网络开放功能向应用功能回复事件订阅响应。
S709、若接入和移动性管理功能确定访问令牌中的服务名称列表为通配符或者订阅/通知指示,且接入和移动性管理功能检测到上述订阅事件被触发,则接入和移动性管理功能向网络开放功能的资源标识对应的网络开放功能发送事件通知。其中,上述事件通知中携带访问令牌。
S710、网络开放功能校验访问令牌的有效性,如用授权服务器公钥校验签名或用共享密钥校验MACs值。若校验通过,则表示允许接入和移动性管理功能访问资源,则网络开放功能向应用功能发送事件通知。
S711、应用功能向网络开放功能回复事件通知响应。
S712、网络开放功能向接入和移动性管理功能回复事件通知响应。
本申请实施例提供的服务授权方法,在客户端向第一服务器发送的第一服务请求消息中携带第一服务器访问第二服务器的服务授权信息,以便第一服务器根据上述服务授权信息访问第二服务器,可以解决第二服务器由客户端发现的场景下,第一服务器访问第二服务器未获服务授权的问题,以降低服务化网络的安全风险。
服务授权方式二
在本申请中,鉴于第二服务器是由客户端发现的也可以由客户端为第一服务器提供第二服务器的信息,如第二服务器的实例标识,或者第二服务器的资源标识等,以便第一服务器根据第二服务器的上述信息自行向授权服务器申请第二服务器的访问权限,如申请访问令牌。
图8示出了本申请实施例提供的基于服务授权方式二的一种服务授权方法的流程 示意图。如图8所示,该服务授权方法包括S801-S805:
S801、客户端向第一服务器发送第一服务请求消息。
S802、客户端接收第一服务器发送的第一服务响应消息。
其中,第一服务请求消息携带服务授权信息。
在一种可能的设计方法中,上述服务授权信息包括第二服务器的实例标识。
在另一种可能的设计方法中,上述服务授权信息包括第二服务器的资源标识,如第二服务器的URI。其中,URI可以采用如下格式的数据结构:
{apiRoot}/{apiName}/{apiVersion}/{apiSpecificResourceUriPart}。
其中,URI可以包含第二服务器主机名。第二服务器的主机名为URI中的apiRoot字段,或者apiRoot字段中的authority/host域。
S803、第一服务器根据服务授权信息获取访问令牌。
其中,访问令牌为第一服务器访问第二服务器时使用。
在一种可能的设计方法中,上述服务授权信息包括第二服务器的实例标识。如图9所示,S803第一服务器根据服务授权信息获取访问令牌,可以包括S901-S902:
S901、第一服务器向授权服务器发送访问令牌请求消息。
其中,访问令牌请求消息携带第二服务器的实例标识,以便授权服务器根据第二服务器的实例标识确定第一服务器有权限访问第二服务器,并为其生成访问令牌。
此外,访问令牌请求消息还可以携带第一服务器的实例标识,以及期望的服务名称列表。其中,期望的服务名称列表可以包括一个或者多个第二服务器的服务名称。
然后,在授权服务器接收到第一服务器发送的访问令牌请求消息之后,授权服务器根据访问令牌请求消息中携带的信息,确定第一服务器可授权访问第二服务器的资源,生成访问令牌,并执行下述S902。
其中,授权服务器根据访问令牌请求消息中携带的信息,确定第一服务器可授权访问第二服务器的资源,可以包括如下步骤:
授权服务器确定允许第一服务器访问第二服务器,以及期望的服务名称列表。
示例性地,生成的访问令牌可以包含授权服务器的实例标识,第一服务器的实例标识,第二服务器的实例标识和服务名称列表,访问令牌过期时间。
需要说明的是,所述访问令牌为JSON Web令牌,如采用JSON Web签名(JSON web signature,JWS)的访问令牌。其中,JSON Web签名可以为数字签名或者消息认证代码(message suthentication vodes,MACs)。
上述第二服务器的资源标识可以为统一资源标识符。上述授权服务器的实例标识、第一服务器的实例标识和第二服务器的实例标识可以为全球唯一标识(universally unique identifier,UUID)格式的网络功能的实例标识。
S902、第一服务器接收授权服务器发送的访问令牌响应消息。其中,访问令牌响应消息携带访问令牌。其中,访问令牌由授权服务器根据第二服务器的实例标识生成。
下面以5G系统中的分组数据单元(packet data unit,PDU)会话建立流程来具体说明图9所示的服务授权方法。其中,接入和移动性管理功能为客户端,拜访地会话管理功能为第一服务器,归属地会话管理功能为第二服务器,网络仓库功能为授权服务器。
如图10所示,图9所示的服务授权方法可以具体实现为S1001-S1012:
S1001、用户设备通过基站,向接入和移动性功能发送PDU会话建立请求。
S1002、接入和移动性管理功能选择拜访地会话管理功能和归属地会话管理功能,如可以通过网元仓库功能选择合适的会话管理功能。
S1003A、接入和移动性管理功能向拜访地会话管理功能发送建立会话管理上下文请求。其中,建立会话管理上下文请求中携带归属地会话管理功能的资源标识和归属地会话管理功能的实例标识。
S1003B、拜访地会话管理功能向接入和移动性管理功能发送建立会话管理上下文响应。
S1004A、拜访地会话管理功能选择拜访地用户面功能,并向拜访地用户面功能发送N4会话建立请求消息。
S1004B、拜访地用户面功能向拜访地会话管理功能发送N4会话建立响应消息。
S1005A、拜访地会话管理功能向网络仓库功能发送访问令牌请求消息。
其中,访问令牌请求消息中携带拜访地会话管理功能的实例标识,归属地会话管理功能的实例标识和期望的服务名称列表。其中,归属地会话管理功能的实例标识为从S1003A中获得,期望的服务名称列表包括下述S1006中需要调用的服务的服务名称。
S1005B、网络仓库功能根据访问令牌请求消息中携带的信息,确定授权访问归属地会话管理功能的资源,生成访问令牌,并向拜访地会话管理功能发送访问令牌响应消息。
若网络仓库功能确定允许拜访地会话管理功能访问归属地会话管理功能,以及归属地会话管理功能对应的期望的服务名称列表,则网络仓库功能生成访问令牌。其中,访问令牌包含网络仓库功能的实例标识,拜访地会话管理功能的实例标识,归属地会话管理功能的实例标识和服务名称列表,访问令牌过期时间。
需要说明的是,访问令牌为JSON Web令牌,如采用JSON Web签名(JSON web signature,JWS)的访问令牌。其中,JSON Web签名可以是数字签名或者消息认证代码(message authentication codes,MACs)。
上述归属地会话管理功能的资源标识可以为统一资源标识符,网络仓库功能的实例标识、拜访地会话管理功能的实例标识和归属地会话管理功能的实例标识可以为UUID格式的网络功能的实例标识。
S1006、若拜访地会话管理功能确定需要调用的归属地会话管理功能的服务名称包含在S1005B中接收到的归属地会话管理功能的服务名称列表中,则拜访地会话管理功能向归属地会话管理功能的资源标识代表的归属地会话管理功能发送建立会话请求消息。其中,建立会话请求消息中携带访问令牌。
S1007、归属地会话管理功能向统一数据管理功能获取当前PDU会话和用户设备对应的会话管理签约数据。
S1008、归属地会话管理功能向归属地策略控制功能获取当前PDU会话相关的策略数据。
S1009A、归属地会话管理功能向归属地用户面功能发送N4会话建立请求消息。
S1009B,归属地用户面功能向归属地会话管理功能回复N4会话建立响应消息。
S1010、归属地会话管理功能校验访问令牌的有效性,如使用网络仓库功能公钥校验签名或用共享密钥校验MAC值进行校验。如果校验通过,则表示允许拜访地会话管理功能访问资源,归属地会话管理功能向拜访地会话管理功能发送建立会话响应消息。
S1011、拜访地会话管理功能发送N1N2消息转发给接入和移动性管理功能,所述消息用于向基站和用户设备发送PDU会话相关的信息。
S1012、接入和移动性管理功能向基站发送PDU会话建立请求消息,将拜访地用户面功能的数据包转发信息等发送给基站。
S1013、基站和用户设备之间进行RRC(Radio Resource Control)连接重配置,建立用户设备和基站间的无线承载。
S1014、基站向接入和移动性管理功能回复PDU会话建立响应,所述消息中携带基站的数据包转发信息等。
S1015、接入和移动性管理功能向拜访地会话管理功能发送PDU会话更新请求消息,所述消息中携带从基站获得的信息。
S1016、拜访地会话管理功能通知拜访地用户面功能建立和基站的业务数据包转发通道。
S1017、拜访地会话管理功能向接入和移动性管理功能回复PDU会话更新响应。在另一种可能的设计方法中,上述服务授权信息包括第二服务器的资源标识。因此,如图11所示,S803第一服务器根据服务授权信息获取访问令牌,可以包括S1101-S1104,共分为如下两个阶段:网络功能发现阶段和访问令牌请求阶段,下面分别说明。
上述网络功能发现阶段可以包括S1101-S1102:
S1101、第一服务器向授权服务器发送网络功能发现请求消息。
其中,网络功能发现请求消息携带第二服务器的主机名;第二服务器的主机名为第二服务器的资源标识的一部分。
其中,第二服务器的资源标识为如下格式:
{apiRoot}/{apiName}/{apiVersion}/{apiSpecificResourceUriPart}。
其中,第二服务器的主机名可以为apiRoot字段,或者apiRoot字段中的authority/host域。
在授权服务器接收到上述网络功能发现请求消息之后,授权服务器可以根据第二服务器主机名确定第二服务器的实例标识,然后向第一服务器发送网络功能发现响应消息。其中,网络功能发现响应消息携带第二服务器的实例标识。
具体的,第二服务器向授权服务器注册时,会携带第二服务器主机名和第二服务器的实例标识等信息。授权服务器接收并存储第二服务器主机名和第二服务器的实例标识。在授权服务器接收到网络功能发现请求消息后,可以根据网络功能发现请求消息携带的第二服务器主机名确定第二服务器的实例标识。
S1102、第一服务器接收授权服务器发送的网络功能发现响应消息。
其中,网络功能发现响应消息携带第二服务器的实例标识。
上述访问令牌请求阶段可以包括S1103-S1104:
S1103、第一服务器向授权服务器发送访问令牌请求消息。
其中,访问令牌请求消息携带第二服务器的实例标识。
此外,访问令牌请求消息还可以携带第二服务器的实例标识和期望的服务名称列表。
在授权服务器接收到上述访问令牌请求消息之后,授权服务器确定允许第一服务器访问第二服务器的资源,及对应的期望的服务名称列表,生成访问令牌,并向第一服务器发送访问令牌响应消息。其中,访问令牌响应消息携带访问令牌。
S1104、第一服务器接收授权服务器发送的访问令牌响应消息。
其中,访问令牌响应消息携带访问令牌,访问令牌由授权服务器根据第二服务器的实例标识生成。
上述访问令牌还可以包括授权服务器的实例标识,第一服务器的实例标识,第二服务器的实例标识和服务名称列表,访问令牌过期时间。
下面以5G系统中的PDU会话建立流程来具体说明图11所示的服务授权方法。其中,接入和移动性管理功能为客户端,拜访地会话管理功能为第一服务器,归属地会话管理功能为第二服务器,网络仓库功能为授权服务器。
如图12所示,图12所示的服务授权方法可以具体实现为S1201-S1220:
S1201、用户设备通过基站,向接入和移动性管理功能发送PDU会话建立请求消息。
S1202、接入和移动性管理功能选择拜访地会话管理功能和归属地会话管理功能。
具体地,接入和移动性管理功能可以通过网络仓库功能选择合适的会话管理功能。
S1203A、接入和移动性管理功能向拜访地会话管理功能发送建立会话管理上下文请求消息。
其中,建立会话管理上下文请求消息中携带归属地会话管理功能的资源标识。
S1203B、拜访地会话管理功能向接入和移动性管理功能回复建立会话管理上下文响应消息。
其中,建立会话管理上下文请求消息中携带归属地会话管理功能的实例标识。
S1204、拜访地会话管理功能选择用户面功能,并向用户面功能发送N4会话建立请求消息。
拜访地会话管理功能需要访问建立会话管理上下文请求消息中携带的归属地会话管理功能的资源标识对应的归属地会话管理的资源。
然后,拜访地会话管理功能可以通过网络仓库功能获取访问归属地会话管理功能的访问令牌。这里有采用上述访问令牌生成方式一生成访问令牌:
访问令牌生成方式一:
S1205A:拜访地会话管理功能通过建立会话管理上下文请求消息中携带归属地会话管理功能的资源标识获得归属地会话管理功能的主机名,向网络仓库功能发送网络功能发现请求消息。其中,归属地会话管理功能的主机名为归属地会话管理功能的资源标识的一部分。归属地会话管理功能的资源标识见下格式,归属地会话管理功能的主机名可以为apiRoot,或者apiRoot中的authority/host。
{apiRoot}/{apiName}/{apiVersion}/{apiSpecificResourceUriPart}。
网络功能发现请求消息中携带归属地会话管理功能的主机名。
S1206A、网络仓库功能根据归属地会话管理功能的主机名确定归属地会话管理功能的实例标识,并向拜访地会话管理功能回复网络功能发现响应消息。其中,网络功能发现响应消息中携带归属地会话管理功能的实例标识。
具体的,归属地会话管理功能向网络仓库功能注册时,携带归属地会话管理功能信息,归属地会话管理功能信息包含归属地会话管理功能的主机名和归属地会话管理功能的实例标识等信息。网络仓库功能接收并存储归属地会话管理功能的上述信息,并根据网络功能发现请求消息中携带的归属地会话管理功能的主机名确定归属地会话管理功能信息中的归属地会话管理功能的实例标识。
S1207A、拜访地会话管理功能向网络仓库功能发送访问令牌请求消息。
其中,访问令牌请求消息中携带拜访地会话管理功能的实例标识,归属地会话管理功能的实例标识和期望的服务名称列表。
S1208A、网络仓库功能根据访问令牌请求消息中携带的信息,确定授权访问归属地会话管理功能的资源,生成访问令牌,并向拜访地会话管理功能发送访问令牌响应消息。
具体地,网络仓库功能根据访问令牌请求消息中携带的信息,确定授权访问归属地会话管理功能的资源,生成访问令牌,包括:
若网络仓库功能确定允许拜访地会话管理功能访问归属地会话管理功能,以及期望的服务名称列表,则网络仓库功能生成访问令牌。
其中,访问令牌包含网络仓库功能的实例标识,拜访地会话管理功能的实例标识,归属地会话管理功能的实例标识和服务名称列表,访问令牌过期时间。
S1209、若拜访地会话管理功能确定需要调用的归属地会话管理功能的服务名称包含在上述访问令牌中的归属地会话管理功能的服务名称列表中,则拜访地会话管理功能向归属地会话管理功能的资源标识对应的归属地会话管理功能发送建立会话请求消息。其中,建立会话请求消息中携带访问令牌。
S1210、归属地会话管理功能向统一数据管理功能获取当前PDU会话/用户设备对应的会话管理签约数据。
S1211、归属地会话管理功能向归属地策略控制功能获取当前PDU会话相关的策略数据。
S1212A、归属地会话管理功能选择归属地用户面功能,并向归属地用户面功能发送N4会话建立请求消息。
S1212B、归属地用户面功能向归属地会话管理功能发送N4会话建立响应消息。
S1213、归属地会话管理功能校验访问令牌的有效性,如使用网络仓库功能公钥校验签名或用共享密钥校验MAC值。如果校验通过,表示允许拜访地会话管理功能访问此服务,则归属地会话管理功能向拜访地会话管理功能发送建立会话响应消息。
S1214、拜访地会话管理功能发送N1N2消息转发给接入和移动性管理功能,所述消息用于向基站和用户设备发送PDU会话相关的信息。
S1215、接入和移动性管理功能向基站发送PDU会话建立请求消息,将拜访地用户面功能的数据包转发信息等发送给基站。
S1216、基站和用户设备之间进行RRC(Radio Resource Control)连接重配置,建立用户设备和基站间的无线承载。
S1217、基站向接入和移动性管理功能回复PDU会话建立响应,所述消息中携带基站的数据包转发信息等。
S1218、接入和移动性管理功能向拜访地会话管理功能发送PDU会话更新请求消息,所述消息中携带从基站获得的信息。
S1219、拜访地会话管理功能通知拜访地用户面功能建立和基站的业务数据包转发通道。
S1220、拜访地会话管理功能向接入和移动性管理功能回复PDU会话更新响应。
在又一种可能的设计方法中,上述服务授权信息包括第二服务器的资源标识。其中,第二服务器的资源标识包括第二服务器的主机名。与图11所示的服务授权方法不同,为了减少第一服务和授权服务器之间的交互次数,提高申请访问令牌的速度,也可以直接将第二服务器的主机名发送给授权服务器,并由授权服务器获取到第二服务器的实例标识后,直接生成访问令牌。也就是说,也可以采用上述令牌生成方式二生成访问令牌。因此,如图13所示,S803第一服务器根据服务授权信息获取访问令牌,也可以包括S1301-S1302:
S1301、第一服务器向授权服务器发送访问令牌请求消息。
其中,访问令牌请求消息携带第二服务器的主机名;第二服务器的主机名为第二服务器的资源标识的一部分。
此外,访问令牌请求消息还可以携带第一服务器的实例标识,以及期望的服务名称列表。
在授权服务器接收到访问令牌请求消息后,可以根据访问令牌请求消息中携带的第二服务器的主机名获取第二服务器的实例标识,并根据第二服务器的实例标识生成访问令牌。
然后,授权服务器可以向第一服务器发送访问令牌响应消息。其中,访问令牌响应消息携带访问令牌。
S1302、第一服务器接收授权服务器发送的访问令牌响应消息。
其中,访问令牌响应消息携带访问令牌,访问令牌由授权服务器根据第二服务器的主机名生成。
上述访问令牌包括授权服务器的实例标识,第一服务器的实例标识,第二服务器的实例标识和服务名称列表,访问令牌过期时间。
下面以5G系统中的PDU会话建立流程来具体说明图13所示的服务授权方法。其中,接入和移动性管理功能为客户端,拜访地会话管理功能为第一服务器,归属地会话管理功能为第二服务器,网络仓库功能为授权服务器。
如图14所示,图13所示的服务授权方法可以具体实现为:S1401-S1404B,以及S1407B-S1420。
其中,S1401-S1404B可以参考S1201-S1204B的相关描述,S1409-S1420可以参考S1209-S1220的相关描述,此处不再赘述。
鉴于与图12所示的服务授权方法相比,图14所示的服务授权方法不包括网络功 能发现阶段,只包括访问令牌请求阶段,即S1407B和S1408B:
S1407B、拜访地会话管理功能向网络仓库功能发送访问令牌请求消息。
其中,访问令牌请求消息中携带拜访地会话管理功能的实例标识和网络功能类型,归属地会话管理功能的主机名和期望的服务名称列表。
S1408B、网络仓库功能根据S1407B中访问令牌请求消息中携带的信息,确定授权访问归属地会话管理功能的资源,生成访问令牌,并向拜访地会话管理功能发送访问令牌响应消息。
具体地,网络仓库功能根据归属地会话管理功能的主机名确定归属地会话管理功能的实例标识(确定方法可以参考访问令牌生成方式一),确定授权访问归属地会话管理功能的实例标识对应的归属地会话管理功能的资源。
需要说明的是,访问令牌为JSON Web令牌,如采用JSON Web签名(JSON web signature,JWS)的访问令牌。其中,JSON Web签名可以为数字签名或者消息认证代码(message authentication codes,MACs)。
上述归属地会话管理功能的资源标识为统一资源标识符,拜访地会话管理功能的实例标识和归属地会话管理功能的实例标识可以为UUID格式的网络功能的实例标识。
S804、第一服务器向第二服务器发送第二服务请求消息。
S805、第一服务器接收第二服务器发送的第二服务响应消息。
其中,第二服务请求消息携带访问令牌。
需要说明的是,对于服务授权方式二,第一服务器只需要为自己申请第二服务器的访问令牌即可。因此,第一服务器为自己申请的访问令牌可以不包括客户端的实例标识。
此外,对于上述服务授权方式二,为了进一步提高申请访问令牌的准确性,除上述第二服务器的实例标识或资源标识外,上述服务授权信息还可以包括第一服务器需要访问的服务名称。因此,可选地,当上述服务授权信息包括第二服务器的实例标识,或者上述服务授权信息包括第二服务器的资源标识时,上述服务授权信息还可以包括第二服务器的服务名称。其中,第二服务器的服务名称为第一服务器需要访问的服务名称。所述第二服务器的服务名称用于所述第一服务器确定期望的服务名称列表,以便所述第一服务器在向所述授权服务器发送访问令牌请求时携带所述期望的服务名称列表。
本申请实施例提供的服务授权方法,在第一服务器根据客户端发送的第一服务请求消息中携带的服务授权信息,自行申请其访问第二服务器的服务授权,并根据申请的服务授权访问第二服务器,可以解决第二服务器由客户端发现的场景下,第一服务器访问第二服务器未获服务授权的问题,以降低服务化网络的安全风险。
以上结合图5-图14详细说明了本申请实施例提供的服务授权方法。以下结合图15至图19详细说明本申请实施例提供的通信装置。
图15是本申请实施例提供的一种通信装置的结构示意图。该通信装置可适用于图1所示出的系统中,执行上述方法实施例中客户端的功能。为了便于说明,图15仅示出了该通信装置的主要部件。如图15所示,通信装置1500包括:发送模块1501。
其中,发送模块1501,用于向第一服务器发送第一服务请求消息。其中,第一服 务请求消息携带服务授权信息;服务授权信息为第一服务器访问第二服务器时使用。
在一种可能的设计中,上述服务授权信息包括访问令牌。结合图15,如图16所示,通信装置1500还包括:接收模块1502。
其中,上述发送模块1501,还用于在发送模块1501向第一服务器发送第一服务请求消息之前,向授权服务器发送访问令牌请求消息。其中,访问令牌请求消息携带通信装置的实例标识和第一服务器的实例标识。
上述接收模块1502,用于接收授权服务器发送的访问令牌响应消息。其中,访问令牌响应消息携带访问令牌。
上述发送模块1501,还用于向第一服务器发送第一服务请求消息。其中,第一服务请求消息包括访问令牌。其中,访问令牌包括第一服务器的实例标识。或者,访问令牌包括通信装置的实例标识和第一服务器的实例标识。
可选地,访问令牌请求消息还携带通信装置的网络功能类型和/或第一服务器的网络功能类型。
可选地,上述访问令牌还可以包括访问令牌过期时间,结合图16,如图17所示,通信装置1500还可以包括:处理模块1503。
其中,处理模块1503,用于若通过访问令牌过期时间确定访问令牌已过期,则控制发送模块1501和接收模块1502向授权服务器申请新的访问令牌,并控制发送模块1501将新的访问令牌通知第一服务器。
可选地,当服务授权信息包括第二服务器的实例标识,或者服务授权信息包括第二服务器的资源标识时,上述服务授权信息还可以包括第二服务器的服务名称;第二服务器的服务名称为第一服务器需要访问的服务名称。
此外,通信装置1500还可以包括:存储模块,用于存储通信装置1500的指令和数据。
需要说明的是,通信装置1500可以是上述客户端,也可以是设置于上述客户端中的芯片系统,本申请对此不做限定。
图18是本申请实施例提供的另一种通信装置的结构示意图。该通信装置可适用于图1所示出的通信系统中,执行上述方法实施例中第一服务器的功能。为了便于说明,图18仅示出了该通信装置的主要部件。如图18所示,通信装置1800包括:接收模块1801、发送模块1802和获取模块1803。
其中,接收模块1801,用于接收客户端发送的第一服务请求消息。其中,第一服务请求消息携带服务授权信息。
获取模块1803,用于根据服务授权信息获取访问令牌。其中,访问令牌为通信装置1800访问第二服务器时使用。
发送模块1802,用于向第二服务器发送第二服务请求消息。其中,第二服务请求消息携带访问令牌。
在一种可能的设计中,上述服务授权信息包括第二服务器的实例标识。
相应地,发送模块1802,还用于向授权服务器发送访问令牌请求消息。其中,访问令牌请求消息携带第二服务器的实例标识。
接收模块1801,还用于接收授权服务器发送的访问令牌响应消息。其中,访问令 牌响应消息携带访问令牌,访问令牌由授权服务器根据第二服务器的实例标识生成。
在另一种可能的设计中,上述服务授权信息包括第二服务器的资源标识。
相应地,发送模块1802,还用于向授权服务器发送网络功能发现请求消息。其中,网络功能发现请求消息携带第二服务器的主机名;第二服务器的主机名为第二服务器的资源标识的一部分。
接收模块1801,还用于接收授权服务器发送的网络功能发现响应消息。其中,网络功能发现响应消息携带第二服务器的实例标识。
发送模块1802,还用于向授权服务器发送访问令牌请求消息。其中,访问令牌请求消息携带第二服务器的实例标识。
接收模块1801,还用于接收授权服务器发送的访问令牌响应消息。其中,访问令牌响应消息携带访问令牌,访问令牌由授权服务器根据第二服务器的实例标识生成。
在又一种可能的设计中,上述服务授权信息包括第二服务器的资源标识。
相应地,发送模块1802,还用于向授权服务器发送访问令牌请求消息。其中,访问令牌请求消息携带第二服务器的主机名;第二服务器的主机名为第二服务器的资源标识的一部分。
接收模块1801,还用于接收授权服务器发送的访问令牌响应消息。其中,访问令牌响应消息携带访问令牌,访问令牌由授权服务器根据第二服务器的主机名生成。
可选地,第一服务器自行申请的访问令牌包括第二服务器的实例标识。
此外,通信装置1800还可以包括:存储模块,用于存储通信装置1500的指令和数据。
需要说明的是,通信装置1800可以是上述第一服务器,也可以是设置于上述第一服务器中的芯片系统,本申请对此不做限定。
图19是本申请实施例提供的又一种通信装置的结构示意图。该通信装置可适用于图1所示出的通信系统中,执行上述方法实施例中客户端的功能,或者执行上述方法实施例中第一服务器的功能。为了便于说明,图19仅示出了该通信装置的主要部件。
如图19所示,通信装置1900,包括:处理器1901和收发器1902。其中,处理器1901与存储器1903耦合,如处理器1901通过总线1904与存储器1903连接;处理器1901用于执行存储器1903中存储的计算机程序,以使得该通信装置1900执行如上述方法实施例中客户端的功能,或者执行如上述方法实施例中第一服务器的功能。
需要说明的是,通信装置1900可以是上述客户端或上述第一服务器,也可以是设置于上述客户端或第一服务器中的芯片系统,本申请对此不做限定。
本申请实施例提供一种通信系统。该通信系统包括上述客户端和第一服务器,以及上述授权服务器和第二服务器。
本申请实施例提供一种计算机可读存储介质,存储有程序或指令,当程序或指令在计算机上运行时,使得计算机执行如上述方法实施例所述的服务授权方法。
本申请实施例提供一种计算机程序产品,包括:计算机程序代码;当计算机程序代码在计算机上运行时,使得计算机执行如上述方法实施例所述的服务授权方法。
应理解,在本申请实施例中的处理器可以是中央处理单元(central processing unit,CPU),该处理器还可以是其他通用处理器、数字信号处理器(digital signal processor, DSP)、专用集成电路(application specific integrated circuit,ASIC)、现成可编程门阵列(field programmable gate array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
还应理解,本申请实施例中的存储器可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(read-only memory,ROM)、可编程只读存储器(programmable ROM,PROM)、可擦除可编程只读存储器(erasable PROM,EPROM)、电可擦除可编程只读存储器(electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(random access memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的随机存取存储器(random access memory,RAM)可用,例如静态随机存取存储器(static RAM,SRAM)、动态随机存取存储器(DRAM)、同步动态随机存取存储器(synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(double data rate SDRAM,DDR SDRAM)、增强型同步动态随机存取存储器(enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(synchlink DRAM,SLDRAM)和直接内存总线随机存取存储器(direct rambus RAM,DR RAM)。
上述实施例,可以全部或部分地通过软件、硬件(如电路)、固件或其他任意组合来实现。当使用软件实现时,上述实施例可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令或计算机程序。在计算机上加载或执行所述计算机指令或计算机程序时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以为通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集合的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质。半导体介质可以是固态硬盘。
应理解,本文中术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况,其中A,B可以是单数或者复数。另外,本文中字符“/”,一般表示前后关联对象是一种“或”的关系,但也可能表示的是一种“和/或”的关系,具体可参考前后文进行理解。
本申请中,“至少一个”是指一个或者多个,“多个”是指两个或两个以上。“以下至少一项(个)”或其类似表达,是指的这些项中的任意组合,包括单项(个)或复数项(个)的任意组合。例如,a,b,或c中的至少一项(个),可以表示:a,b,c,a-b,a-c,b-c,或a-b-c,其中a,b,c可以是单个,也可以是多个。
应理解,在本申请的各种实施例中,上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的 实施过程构成任何限定。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read-only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。

Claims (22)

  1. 一种服务授权方法,其特征在于,包括:
    客户端向第一服务器发送第一服务请求消息;其中,所述第一服务请求消息携带服务授权信息;所述服务授权信息为所述第一服务器访问第二服务器时使用。
  2. 根据权利要求1所述的服务授权方法,其特征在于,所述服务授权信息包括访问令牌;
    在所述客户端向第一服务器发送第一服务请求消息之前,所述服务授权方法还包括:
    所述客户端向授权服务器发送访问令牌请求消息;其中,所述访问令牌请求消息携带所述客户端的实例标识和所述第一服务器的实例标识;
    所述客户端接收所述授权服务器发送的访问令牌响应消息;其中,所述访问令牌响应消息携带所述访问令牌;
    所述客户端向第一服务器发送第一服务请求消息,包括:
    所述客户端向所述第一服务器发送所述第一服务请求消息;其中,所述第一服务请求消息包括所述访问令牌;
    其中,所述访问令牌包括所述第一服务器的实例标识;或者,
    所述访问令牌包括所述客户端的实例标识和所述第一服务器的实例标识。
  3. 根据权利要求2所述的服务授权方法,其特征在于,所述访问令牌请求消息还携带所述客户端的网络功能类型和/或所述第一服务器的网络功能类型。
  4. 根据权利要求2或3所述的服务授权方法,其特征在于,所述访问令牌还包括访问令牌过期时间;
    所述服务授权方法还包括:
    若所述客户端通过所述访问令牌过期时间确定所述访问令牌已过期,则所述客户端向所述授权服务器申请新的访问令牌,并将所述新的访问令牌通知所述第一服务器。
  5. 根据权利要求1所述的服务授权方法,其特征在于,所述服务授权信息包括所述第二服务器的实例标识,或者所述服务授权信息包括所述第二服务器的资源标识。
  6. 根据权利要求5所述的服务授权方法,其特征在于,所述服务授权信息还包括所述第二服务器的服务名称;所述第二服务器的服务名称为所述第一服务器需要访问的服务名称。
  7. 一种服务授权方法,其特征在于,包括:
    第一服务器接收客户端发送的第一服务请求消息;其中,所述第一服务请求消息携带服务授权信息;
    所述第一服务器根据所述服务授权信息获取访问令牌;所述第一服务器向第二服务器发送第二服务请求消息;其中,所述第二服务请求消息携带所述访问令牌。
  8. 根据权利要求7所述的服务授权方法,其特征在于,所述服务授权信息包括所述第二服务器的实例标识;
    所述第一服务器根据所述服务授权信息获取访问令牌,包括:
    所述第一服务器向授权服务器发送访问令牌请求消息;其中,所述访问令牌请求消息携带所述第二服务器的实例标识;
    所述第一服务器接收所述授权服务器发送的访问令牌响应消息;其中,所述访问令牌响应消息携带所述访问令牌,所述访问令牌由所述授权服务器根据所述第二服务器的实例标识生成。
  9. 根据权利要求7所述的服务授权方法,其特征在于,所述服务授权信息包括所述第二服务器的资源标识;
    所述第一服务器根据所述服务授权信息获取访问令牌,包括:
    所述第一服务器向授权服务器发送网络功能发现请求消息;其中,所述网络功能发现请求消息携带所述第二服务器的主机名;所述第二服务器的主机名为所述第二服务器的资源标识的一部分;
    所述第一服务器接收所述授权服务器发送的网络功能发现响应消息;其中,所述网络功能发现响应消息携带所述第二服务器的实例标识;
    所述第一服务器向所述授权服务器发送访问令牌请求消息;其中,所述访问令牌请求消息携带所述第二服务器的实例标识;
    所述第一服务器接收所述授权服务器发送的访问令牌响应消息;其中,所述访问令牌响应消息携带所述访问令牌,所述访问令牌由所述授权服务器根据所述第二服务器的实例标识生成。
  10. 根据权利要求7所述的服务授权方法,其特征在于,所述服务授权信息包括所述第二服务器的资源标识;
    所述第一服务器根据所述服务授权信息获取访问令牌,包括:
    所述第一服务器向授权服务器发送访问令牌请求消息;其中,所述访问令牌请求消息携带所述第二服务器的主机名;所述第二服务器的主机名为所述第二服务器的资源标识的一部分;
    所述第一服务器接收所述授权服务器发送的访问令牌响应消息;其中,所述访问令牌响应消息携带所述访问令牌,所述访问令牌由所述授权服务器根据所述第二服务器的主机名生成。
  11. 根据权利要求8-10中任一项所述的服务授权方法,其特征在于,所述访问令牌包括所述第二服务器的实例标识。
  12. 一种通信装置,其特征在于,包括:发送模块;其中,
    所述发送模块,用于向第一服务器发送第一服务请求消息;其中,所述第一服务请求消息携带服务授权信息;所述服务授权信息为所述第一服务器访问第二服务器时使用。
  13. 根据权利要求12所述的通信装置,其特征在于,所述服务授权信息包括访问令牌;
    所述发送模块,还用于在所述发送模块向第一服务器发送第一服务请求消息之前,向授权服务器发送访问令牌请求消息;其中,所述访问令牌请求消息携带所述通信装置的实例标识和所述第一服务器的实例标识;
    所述通信装置还包括:接收模块;其中,
    所述接收模块,用于接收所述授权服务器发送的访问令牌响应消息;其中,所述访问令牌响应消息携带所述访问令牌;
    所述发送模块,还用于向所述第一服务器发送所述第一服务请求消息;其中,所述第一服务请求消息包括所述访问令牌;
    其中,所述访问令牌包括所述第一服务器的实例标识;或者,
    所述访问令牌包括所述通信装置的实例标识和所述第一服务器的实例标识。
  14. 根据权利要求13所述的通信装置,其特征在于,所述访问令牌请求消息还携带所述通信装置的网络功能类型和/或所述第一服务器的网络功能类型。
  15. 根据权利要求13或14所述的通信装置,其特征在于,所述访问令牌还包括访问令牌过期时间;
    所述通信装置还包括:处理模块;其中,
    所述处理模块,用于若通过所述访问令牌过期时间确定所述访问令牌已过期,则控制所述发送模块和所述接收模块向所述授权服务器申请新的访问令牌,并控制所述发送模块将所述新的访问令牌通知所述第一服务器。
  16. 根据权利要求12所述的通信装置,其特征在于,所述服务授权信息包括所述第二服务器的实例标识,或者所述服务授权信息包括所述第二服务器的资源标识。
  17. 根据权利要求16所述的通信装置,其特征在于,所述服务授权信息还包括所述第二服务器的服务名称;所述第二服务器的服务名称为所述第一服务器需要访问的服务名称。
  18. 一种通信装置,其特征在于,包括:接收模块、发送模块和获取模块;其中,
    所述接收模块,用于接收客户端发送的第一服务请求消息;其中,所述第一服务请求消息携带服务授权信息;
    所述获取模块,用于根据所述服务授权信息获取访问令牌;所述发送模块,用于向第二服务器发送第二服务请求消息;其中,所述第二服务请求消息携带所述访问令牌。
  19. 根据权利要求18所述的通信装置,其特征在于,所述服务授权信息包括所述第二服务器的实例标识;
    所述发送模块,还用于向授权服务器发送访问令牌请求消息;其中,所述访问令牌请求消息携带所述第二服务器的实例标识;
    所述接收模块,还用于接收所述授权服务器发送的访问令牌响应消息;其中,所述访问令牌响应消息携带所述访问令牌,所述访问令牌由所述授权服务器根据所述第二服务器的实例标识生成。
  20. 根据权利要求18所述的通信装置,其特征在于,所述服务授权信息包括所述第二服务器的资源标识;
    所述发送模块,还用于向授权服务器发送网络功能发现请求消息;其中,所述网络功能发现请求消息携带所述第二服务器的主机名;所述第二服务器的主机名为所述第二服务器的资源标识的一部分;
    所述接收模块,还用于接收所述授权服务器发送的网络功能发现响应消息;其中,所述网络功能发现响应消息携带所述第二服务器的实例标识;
    所述发送模块,还用于向所述授权服务器发送访问令牌请求消息;其中,所述访问令牌请求消息携带所述第二服务器的实例标识;
    所述接收模块,还用于接收所述授权服务器发送的访问令牌响应消息;其中,所述访问令牌响应消息携带所述访问令牌,所述访问令牌由所述授权服务器根据所述第二服务器的实例标识生成。
  21. 根据权利要求18所述的通信装置,其特征在于,所述服务授权信息包括所述第二服务器的资源标识;
    所述发送模块,还用于向授权服务器发送访问令牌请求消息;其中,所述访问令牌请求消息携带所述第二服务器的主机名;所述第二服务器的主机名为所述第二服务器的资源标识的一部分;
    所述接收模块,还用于接收所述授权服务器发送的访问令牌响应消息;其中,所述访问令牌响应消息携带所述访问令牌,所述访问令牌由所述授权服务器根据所述第二服务器的主机名生成。
  22. 根据权利要求19-21中任一项所述的通信装置,其特征在于,所述访问令牌包括所述第二服务器的实例标识。
PCT/CN2019/110638 2018-10-29 2019-10-11 服务授权方法及通信装置 WO2020088213A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP19878158.5A EP3863253A4 (en) 2019-10-11 Service authorization method and communication apparatus
US17/237,297 US20210250344A1 (en) 2018-10-29 2021-04-22 Service authorization method and communications apparatus

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811268836.4 2018-10-29
CN201811268836.4A CN111107047B (zh) 2018-10-29 2018-10-29 服务授权方法及通信装置

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/237,297 Continuation US20210250344A1 (en) 2018-10-29 2021-04-22 Service authorization method and communications apparatus

Publications (1)

Publication Number Publication Date
WO2020088213A1 true WO2020088213A1 (zh) 2020-05-07

Family

ID=70419475

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/110638 WO2020088213A1 (zh) 2018-10-29 2019-10-11 服务授权方法及通信装置

Country Status (3)

Country Link
US (1) US20210250344A1 (zh)
CN (2) CN111107047B (zh)
WO (1) WO2020088213A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023274567A1 (en) * 2021-07-02 2023-01-05 Lenovo (Singapore) Pte. Ltd Establishing a trust relationship between an application entity and a wireless communication network

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111639319B (zh) * 2020-06-02 2023-04-25 抖音视界有限公司 用户资源授权方法、装置及计算机可读存储介质
AR123190A1 (es) * 2020-08-10 2022-11-09 Ericsson Telefon Ab L M Método y aparato de comunicación de seguridad
EP3982615A1 (en) * 2020-10-12 2022-04-13 Nokia Technologies Oy Authorization in communication networks
EP4047867A1 (en) * 2021-02-19 2022-08-24 Nokia Technologies Oy Enhanced authorization in cellular communication networks
CN114095200B (zh) * 2021-09-28 2023-12-01 阿里巴巴(中国)有限公司 资源访问权限管理方法、装置、电子设备及介质
WO2024027630A1 (en) * 2022-08-05 2024-02-08 Telefonaktiebolaget Lm Ericsson (Publ) Method and apparatus for authorization alignment
WO2024072653A1 (en) * 2022-09-29 2024-04-04 Welch Allyn, Inc. Authentication of medical devices

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102946397A (zh) * 2012-11-26 2013-02-27 北京奇虎科技有限公司 用户认证方法及系统
CN105991514A (zh) * 2015-01-28 2016-10-05 阿里巴巴集团控股有限公司 一种业务请求认证方法及装置
CN107317787A (zh) * 2016-04-26 2017-11-03 北京京东尚科信息技术有限公司 服务授信方法、设备及系统
US20180077135A1 (en) * 2016-09-09 2018-03-15 Paypal, Inc. Eliminating abuse caused by password reuse in different systems
CN108665946A (zh) * 2018-05-08 2018-10-16 阿里巴巴集团控股有限公司 一种业务数据的访问方法和装置

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8959347B2 (en) * 2011-08-29 2015-02-17 Salesforce.Com, Inc. Methods and systems of data security in browser storage
CN104022875B (zh) * 2013-03-01 2017-09-01 中兴通讯股份有限公司 一种双向授权系统、客户端及方法
EP3231133B1 (en) * 2015-04-07 2020-05-27 Hewlett-Packard Development Company, L.P. Providing selective access to resources
CN107659406B (zh) * 2016-07-25 2021-06-01 华为技术有限公司 一种资源操作方法及装置
JP6857065B2 (ja) * 2017-03-27 2021-04-14 キヤノン株式会社 認証認可サーバー、リソースサーバー、認証認可システム、認証方法及びプログラム
US10708053B2 (en) * 2017-05-19 2020-07-07 Intuit Inc. Coordinating access authorization across multiple systems at different mutual trust levels

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102946397A (zh) * 2012-11-26 2013-02-27 北京奇虎科技有限公司 用户认证方法及系统
CN105991514A (zh) * 2015-01-28 2016-10-05 阿里巴巴集团控股有限公司 一种业务请求认证方法及装置
CN107317787A (zh) * 2016-04-26 2017-11-03 北京京东尚科信息技术有限公司 服务授信方法、设备及系统
US20180077135A1 (en) * 2016-09-09 2018-03-15 Paypal, Inc. Eliminating abuse caused by password reuse in different systems
CN108665946A (zh) * 2018-05-08 2018-10-16 阿里巴巴集团控股有限公司 一种业务数据的访问方法和装置

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023274567A1 (en) * 2021-07-02 2023-01-05 Lenovo (Singapore) Pte. Ltd Establishing a trust relationship between an application entity and a wireless communication network

Also Published As

Publication number Publication date
US20210250344A1 (en) 2021-08-12
EP3863253A1 (en) 2021-08-11
CN111107047B (zh) 2021-03-23
CN113132355A (zh) 2021-07-16
CN111107047A (zh) 2020-05-05

Similar Documents

Publication Publication Date Title
WO2020088213A1 (zh) 服务授权方法及通信装置
US20220052992A1 (en) Identity verification method for network function service and related apparatus
US10743279B2 (en) Network registration and network slice selection system and method
US20200296142A1 (en) User Group Establishment Method and Apparatus
WO2021189828A1 (zh) 一种服务授权方法、装置及系统
WO2019011203A1 (zh) 设备接入方法、设备及系统
US20210168139A1 (en) Network Slice Authentication Method and Communications Apparatus
KR102544113B1 (ko) 5g 코어 시스템의 네트워크 기능 인증 방법
WO2022089290A1 (zh) 一种服务授权方法、通信装置及系统
WO2021197347A1 (zh) 通信系统、方法及装置
CN115004742A (zh) 在通信网络中用于与服务应用的加密通信的锚密钥生成和管理的方法、设备和系统
CN115462108A (zh) 无密码无线认证
WO2021031055A1 (zh) 通信方法及装置
WO2022067831A1 (zh) 一种建立安全通信方法及装置
JP2023519997A (ja) 端末パラメータ更新を保護するための方法および通信装置
WO2023142102A1 (en) Security configuration update in communication networks
WO2024037215A1 (zh) 通信方法及装置
WO2023143459A1 (zh) 授权方法及装置
WO2023216272A1 (zh) 密钥管理方法、装置、设备及存储介质
US20240236080A1 (en) Systems and methods for service authorization in a delegated discovery deployment
WO2021036627A1 (zh) 一种通信系统、方法及装置
WO2022104740A1 (zh) 一种非公共网络签约信息更新方法及装置
US20240137761A1 (en) Method, device and computer program product for wireless communication
US20240236668A9 (en) Method, device and computer program product for wireless communication
WO2023072275A1 (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: 19878158

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 2019878158

Country of ref document: EP

Effective date: 20210503