A token cross-region exchange and authentication method and system
By using token-based cross-regional exchange and authentication methods, the problem of inconvenient cross-domain access is solved, ensuring smooth cross-domain access and verifying the legitimacy of user identities, reducing frequent data center interactions, and avoiding the storage of user information from outside the local region.
Patent Information
- Application Number
- CN202211079027.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-05
- Publication Date
- 2024-11-05
- Estimated Expiration
- 2042-09-05
AI Technical Summary
Cross-domain access is inconvenient, especially in cross-border and cross-regional systems, where there are problems such as network latency and inconvenience in data exchange. Furthermore, browser restrictions on cross-domain requests prevent front-end scripts from loading resources from different domains.
A method for cross-regional token exchange and authentication is constructed. By encrypting the token's identity information and information signature, user identity verification and signature decryption are performed to generate an access whitelist. The domain name of the front-end address is added to the cross-domain resource sharing response header to allow cross-domain access.
To ensure smooth cross-domain access, reduce frequent interactions between data centers, avoid storing user information registered outside the local area in different regions, and ensure the legitimacy of user identities.
Smart Images

Figure CN115499180B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of cross-domain access technology, and in particular to a token cross-region exchange and authentication method and system. Background Art
[0002] For systems with cross-border and cross-regional business, different data centers between regions need to share data and access authentication, which puts a high test on data consistency and network latency. Generally, it is necessary to purchase a dedicated network line to speed up access.
[0003] The network delay caused by the physical distance between different countries and regions affects the system availability. In addition, due to political or legal reasons, different countries cannot directly and smoothly access data, causing inconvenience in cross-domain data access.
[0004] For security reasons, browsers will restrict cross-domain requests initiated from page scripts. Some browsers will not restrict the initiation of cross-domain requests, but will intercept the results. This means that front-end scripts can only load resources under the same domain. Summary of the invention
[0005] The technical problem to be solved by the present invention is to provide a token cross-region exchange and authentication method and system in view of at least one defect of the prior art: inconvenience in cross-domain access.
[0006] The technical solution adopted by the present invention to solve the technical problem is: constructing a token cross-region exchange and authentication method, which is applied to the target service area, and the method comprises:
[0007] Receive the encrypted token identity information and information signature sent by the front end, wherein the encrypted token identity information and information signature are sent to the front end after the user accesses the front end and the front end sends a switching area request to the current service area, and then the current service area performs user identity verification and encryption signature;
[0008] Verify and decrypt the encrypted token identity information and information signature, and generate an access whitelist;
[0009] The domain name of the front-end address is added to a cross-domain resource sharing response header that allows cross-domain access, and sent to the front-end for the front-end to load the content from the target service area to the page. Preferably, in the token cross-region exchange and authentication method of the present invention, the token identity information includes the value of the access token, the Internet address of the switching visitor, and the timestamp.
[0010] Preferably, in the token cross-region exchange and authentication method of the present invention, the domain name of the front-end address is added to the cross-domain resource sharing response header that allows cross-domain access and sent to the front-end, and then further includes:
[0011] When the area is switched successfully and the user accesses a function through the front end, the legitimacy of the user is verified according to the access whitelist;
[0012] In response to the function information, the domain name of the front-end address is added to the cross-domain resource sharing response header that allows cross-domain access;
[0013] The cross-domain resource sharing response header allowing cross-domain access is sent to the front end, so that the front end loads the function information from the target service area to the page.
[0014] Preferably, in the token cross-region exchange and authentication method of the present invention, verifying the legitimacy of the user according to the access whitelist includes:
[0015] Verify the legitimacy of the value of the user token and the user's Internet address in the whitelist.
[0016] Preferably, in the token cross-region exchange and authentication method of the present invention, the user identity verification and encryption signature are performed by the current service area, including:
[0017] The token identity information is combined and encrypted in the current service area using the public key of the target service area to generate an encrypted string; and the encrypted string is encrypted in the current service area using the private key of the current service area to generate the information signature.
[0018] Preferably, in the token cross-region exchange and authentication method of the present invention, the encrypted token identity information and information signature are verified and decrypted, including:
[0019] After verifying the signature of the information using the public key of the current service area, the encrypted token identity information is decrypted using the private key of the target service area.
[0020] Preferably, in the token cross-region exchange and authentication method of the present invention, generating an access whitelist also includes:
[0021] The validity period of the timestamp in the token identity information is verified, and if the verified timestamp is within the validity period, the user token and the user Internet address are used to generate the access whitelist.
[0022] The present invention also constructs a token cross-region exchange and authentication method, which is applied to the current service area, and the method includes:
[0023] receiving a region switching request sent by a user through the front end when the user accesses the front end;
[0024] Verifying user identity information of the area switching request;
[0025] Encrypt token identity information and generate information signature;
[0026] The encrypted token identity information and the information signature are sent to the front end. The encrypted token identity information and the information signature are used by the front end to send to the target service area for signature verification and decryption, and generate an access whitelist. The target service area adds the domain name of the front end address to a cross-domain resource sharing response header that allows cross-domain access, and sends the cross-domain resource sharing response header that allows cross-domain access to the front end, so that the front end can load the content from the target service area to the page.
[0027] Preferably, in the token cross-region exchange and authentication method of the present invention, the token identity information includes the value of the access token, the Internet address of the switching visitor and the timestamp.
[0028] Preferably, in the token cross-region exchange and authentication method of the present invention, encrypting the token identity information and generating an information signature comprises:
[0029] The token identity information is combined and encrypted using the public key of the target service area to generate an encrypted string; and the encrypted string is encrypted using the private key of the current service area to generate the information signature.
[0030] Preferably, in the token cross-region exchange and authentication method of the present invention, the encrypted token identity information and information signature are used by the front end to send to the target service area for signature verification and decryption, including:
[0031] The information signature is verified in the target service area using the public key of the current service area and then the encrypted token identity information is decrypted using the private key of the target service area.
[0032] Preferably, in the token cross-region exchange and authentication method of the present invention, generating an access whitelist also includes:
[0033] The decryption enables the target service area to obtain the token identity information and verify the validity period of the timestamp in the token identity information. The validity period of the verification timestamp is used to trigger that when the verification timestamp is within the validity period, the user token and the user Internet address are added to the access whitelist.
[0034] The present invention also constructs a token cross-region exchange and authentication method, which is applied to the front end, and the method includes:
[0035] Sending a switching area request triggered by user access to the current service area, wherein the user identity information in the switching request is used by the current service area to verify the user identity information and perform encryption and signature to generate the encrypted token identity information and information signature;
[0036] Receiving the encrypted token identity information and information signature sent by the current service area;
[0037] Send the encrypted token identity information and information signature to the target service area for the target service area to verify and decrypt the signature and generate an access whitelist. The target service area adds the domain name of the front-end address to the cross-domain resource sharing response header that allows cross-domain access.
[0038] The cross-domain resource sharing response header that allows cross-domain access is received, and the content from the target service area is loaded into the page.
[0039] Preferably, in the token cross-region exchange and authentication method of the present invention, the token identity information includes the value of the access token, the Internet address of the switching visitor and the timestamp.
[0040] Preferably, in the token cross-region exchange and authentication method of the present invention, after receiving the cross-domain resource sharing response header that allows cross-domain access, it also includes:
[0041] A function for accessing a target service area after the area switching is successful, wherein the target service area verifies the legitimacy of the user according to the access whitelist, and responds to the function information by adding the domain name of the front-end address to a cross-domain resource sharing response header that allows cross-domain access;
[0042] The cross-domain resource sharing response header allowing cross-domain access sent by the target service area is received, and is used to load the function information from the target service area to the page.
[0043] Preferably, in the token cross-region exchange and authentication method of the present invention, verifying the legitimacy of the user according to the access whitelist includes:
[0044] Verify the legitimacy of the user token and the user Internet address in the whitelist.
[0045] Preferably, in the token cross-region exchange and authentication method of the present invention, the current service area verifies the token identity information and performs encryption and signature to generate the encrypted token identity information and information signature, including:
[0046] The token identity information is combined in the current service area, and encrypted using the public key of the target service area to generate an encrypted string; and the encrypted string is encrypted using the private key of the current service area in the current service area to generate the information signature.
[0047] Preferably, in the token cross-region exchange and authentication method of the present invention, sending the encrypted token identity information and information signature to the target service area for signature verification and decryption by the target service area includes:
[0048] After verifying the signature of the information in the target service area using the public key of the current service area, the encrypted token identity information is decrypted using the private key of the target service area.
[0049] Preferably, in the token cross-region exchange and authentication method of the present invention, generating an access whitelist also includes:
[0050] The decryption enables the target service area to obtain the token identity information within the target service area. The token identity information is used to verify the validity period of the timestamp. The validity period of the timestamp in the token identity information is verified. If the verified timestamp is within the validity period, the user token and the user Internet address are used to generate the access whitelist.
[0051] The present invention also constructs a token cross-region exchange and authentication system, which is applied to the target service area and includes:
[0052] A first receiving module is used to receive the encrypted token identity information and information signature sent by the front end, wherein the encrypted token identity information and information signature are sent to the front end after the user accesses the front end and the front end sends a switching area request to the current service area, and then the current service area performs user identity verification and encryption signature;
[0053] A signature verification and decryption module, used to verify and decrypt the encrypted token identity information and information signature, and generate an access whitelist;
[0054] The first processing module is used to add the domain name of the front-end address to a cross-domain resource sharing response header that allows cross-domain access, and send it to the front-end, so that the front-end loads the content from the target service area to the page.
[0055] Preferably, in the token cross-region exchange and authentication system of the present invention, the token identity information includes the value of the access token, the Internet address of the switching visitor and the timestamp.
[0056] Preferably, in the token cross-region exchange and authentication system of the present invention, the system further comprises:
[0057] A first verification module is used to verify the legitimacy of the user according to the access whitelist when the area is successfully switched and the user accesses a function through the front end;
[0058] A second processing module is used to respond to the function information and add the domain name of the front-end address to a cross-domain resource sharing response header that allows cross-domain access;
[0059] The first sending module is used to send the cross-domain resource sharing response header that allows cross-domain access to the front end, so that the front end loads the function information from the target service area to the page.
[0060] Preferably, in the token cross-region exchange and authentication system of the present invention, the system includes:
[0061] Verify the legitimacy of the value of the user token and the user's Internet address in the whitelist.
[0062] Preferably, in the token cross-region exchange and authentication system of the present invention, the system includes:
[0063] The token identity information is combined and encrypted in the current service area using the public key of the target service area to generate an encrypted string; and the encrypted string is encrypted in the current service area using the private key of the current service area to generate the information signature.
[0064] Preferably, in the token cross-region exchange and authentication system of the present invention, the system includes:
[0065] After verifying the signature of the information using the public key of the current service area, the encrypted token identity information is decrypted using the private key of the target service area.
[0066] Preferably, in the token cross-region exchange and authentication system of the present invention, the system further comprises:
[0067] The validity period of the timestamp in the token identity information is verified, and if the verified timestamp is within the validity period, the user token and the user Internet address are used to generate the access whitelist.
[0068] The present invention also constructs a token cross-region exchange and authentication system, which is applied to the current service area and includes:
[0069] A second receiving module, used for receiving a switching area request sent by the front end when a user accesses the front end;
[0070] A second verification module, used to verify the user identity information of the switching area request;
[0071] An encryption module, used for encrypting the token identity information and generating an information signature;
[0072] The second sending module is used to send the encrypted token identity information and the information signature to the front end, the encrypted token identity information and the information signature are used by the front end to send to the target service area for signature verification and decryption, and generate an access whitelist, the target service area adds the domain name of the front end address to the cross-domain resource sharing response header that allows cross-domain access, and sends the cross-domain resource sharing response header that allows cross-domain access to the front end, so that the front end loads the content from the target service area to the page.
[0073] Preferably, in the token cross-region exchange and authentication system of the present invention, the token identity information includes the value of the access token, the Internet address of the switching visitor and the timestamp.
[0074] Preferably, in the token cross-region exchange and authentication system of the present invention, the system includes:
[0075] The token identity information is combined and encrypted using the public key of the target service area to generate an encrypted string; and the encrypted string is encrypted using the private key of the current service area to generate the information signature.
[0076] Preferably, in the token cross-region exchange and authentication system of the present invention, the system includes:
[0077] The information signature is verified in the target service area using the public key of the current service area and then the encrypted token identity information is decrypted using the private key of the target service area.
[0078] Preferably, in the token cross-region exchange and authentication system of the present invention, the system further comprises:
[0079] The decryption enables the target service area to obtain the token identity information and verify the validity period of the timestamp in the token identity information. The validity period of the verification timestamp is used to trigger that when the verification timestamp is within the validity period, the user token and the user Internet address are added to the access whitelist.
[0080] The present invention also constructs a token cross-region exchange and authentication system, which is applied to the front end and includes:
[0081] A third sending module is used to send a switching area request triggered by user access to the current service area, and the user identity information in the switching request is used by the current service area to verify the user identity information and perform encryption and signature to generate the encrypted token identity information and the information signature;
[0082] A third receiving module, configured to receive the encrypted token identity information and information signature sent by the current service area;
[0083] A fourth sending module is used to send the encrypted token identity information and information signature to the target service area, so that the target service area can verify and decrypt the signature and generate an access whitelist. The target service area adds the domain name of the front-end address to the cross-domain resource sharing response header that allows cross-domain access.
[0084] The fourth receiving module is used to receive the cross-domain resource sharing response header that allows cross-domain access, and load the content from the target service area to the page.
[0085] Preferably, in the token cross-region exchange and authentication system of the present invention, the token identity information includes the value of the access token, the Internet address of the switching visitor and the timestamp.
[0086] Preferably, in the token cross-region exchange and authentication system of the present invention, the system further comprises:
[0087] A third processing module is used for accessing the function of the target service area after the area switching is successful, and for the target service area to verify the legitimacy of the user according to the access whitelist, and respond to the function information by adding the domain name of the front-end address to the cross-domain resource sharing response header that allows cross-domain access;
[0088] The fifth receiving module is used to receive the cross-domain resource sharing response header allowing cross-domain access sent by the target service area, and is used to load the function information from the target service area to the page.
[0089] Preferably, in the token cross-region exchange and authentication system of the present invention, the system includes:
[0090] Verify the legitimacy of the user token and the user Internet address in the whitelist.
[0091] Preferably, in the token cross-region exchange and authentication system of the present invention, the system includes:
[0092] The token identity information is combined in the current service area, and encrypted using the public key of the target service area to generate an encrypted string; and the encrypted string is encrypted using the private key of the current service area in the current service area to generate the information signature.
[0093] Preferably, in the token cross-region exchange and authentication system of the present invention, the system includes:
[0094] After verifying the signature of the information in the target service area using the public key of the current service area, the encrypted token identity information is decrypted using the private key of the target service area.
[0095] Preferably, in the token cross-region exchange and authentication system of the present invention, the system further comprises:
[0096] The decryption enables the target service area to obtain the token identity information within the target service area. The token identity information is used to verify the validity period of the timestamp. The validity period of the timestamp in the token identity information is verified. If the verified timestamp is within the validity period, the user token and the user Internet address are used to generate the access whitelist.
[0097] By implementing the present invention, the following beneficial effects are achieved:
[0098] The user sends a request to switch regions through the front end, verifies the user identity in the current service area, encrypts the user's identity information and generates an information signature, and then sends the encrypted token identity information and information signature to the front end, which is sent to the target service area through the front end for signature verification and decryption, generates an access whitelist in the target service area and adds the source domain to the cross-domain resource sharing response header that allows cross-domain access, and then sends the cross-domain resource sharing response header that allows cross-domain access to the front end, and displays the cross-domain switching success in the front end. After the switch is successful, when the user selects the function of the target area according to the front end, the target service area verifies the legitimacy of the user identity in the whitelist, thereby responding to the function information, adding the domain name containing the source domain to the cross-domain resource sharing response header that allows cross-domain access and transmitting it to the front end, and the browser in the front end parses and renders the page normally to display the function information accessed by the user. By implementing the present invention, there is no need to synchronize tokens between data centers in different regions during cross-domain access, which reduces the frequent interaction between data centers, and different regional data centers will not store user information registered in non-regions. BRIEF DESCRIPTION OF THE DRAWINGS
[0099] The present invention will be further described below with reference to the accompanying drawings and embodiments, in which:
[0100] Figure 1 It is a flow chart of the token cross-region exchange and authentication method of the present invention;
[0101] Figure 2 It is a flow chart of the token cross-region exchange and authentication method of the present invention applied to the target service area;
[0102] Figure 3 It is a flow chart of the token cross-region exchange and authentication method of the present invention applied to the current service area;
[0103] Figure 4 It is a flow chart of the token cross-region exchange and authentication method of the present invention applied to the front end;
[0104] Figure 5 It is a module block diagram of the token cross-region exchange and authentication system of the present invention applied to the target service area;
[0105] Figure 6 It is a module block diagram of the token cross-region exchange and authentication system of the present invention applied to the current service area;
[0106] Figure 7 It is a module block diagram of the token cross-region exchange and authentication system of the present invention applied to the front end. DETAILED DESCRIPTION
[0107] In order to have a clearer understanding of the technical features, purposes and effects of the present invention, specific embodiments of the present invention are now described in detail with reference to the accompanying drawings.
[0108] It should be noted that the flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor do they have to be executed in the order described. For example, some operations / steps can be decomposed, while some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0109] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0110] In this embodiment, if Figure 1 and Figure 2 As shown, the present invention constructs a token cross-region exchange and authentication method, which is applied to the target service area and includes the following steps:
[0111] Receive the encrypted token identity information and information signature sent by the front end. The encrypted token identity information and information signature are sent to the front end after the user sends a switching area request to the current service area through the front end when the user accesses the front end, and then the current service area performs user identity verification and encryption signature;
[0112] Verify and decrypt the encrypted token identity information and information signature, and generate an access whitelist;
[0113] The domain name of the front-end address is added to the cross-origin resource sharing response header that allows cross-domain access, and sent to the front-end for the front-end to load the content from the target service area to the page.
[0114] Before users switch areas to access, they need to register and log in to their account.
[0115] Preferably, after generating the encrypted token identity information and information signature, the address of the source request domain will be added to the cross-domain resource sharing response header that allows cross-domain access in the current service area, and then the encrypted token identity information and information signature will be sent to the front end.
[0116] Preferably, when the domain name of the user's current browser address is www.cn.com and the domain name of the target service area is www.us.com, the domain name sent by the user through the front end is received. When the source request domain is allowed to access, the domain name www.cn.com of the source request domain is placed in the cross-domain resource sharing response header that allows cross-domain access and transmitted to the front end. The front end receives the response header with www.cn.com, and the browser will normally parse and render the page to show that the area switching is successful. At this time, the browser address is still www.cn.com, but the content loaded in the page comes from the domain name www.us.com returned, and the value of the token will be cached in the front end. When access is made, the token will be brought back to the target service area for authorization and legality verification.
[0117] Among them, cross-origin resource sharing is to add a set of HTTP header fields to allow the service to declare what resources the origin station has permission to access. By adding a set of newly added HTTP header fields to the response header of the response message, the front-end browser automatically recognizes that cross-origin data loading is allowed.
[0118] In some embodiments, the token identity information includes the value of the access token, the Internet address of the accessor, and a timestamp.
[0119] In some embodiments, the domain name of the front-end address is added to a cross-domain resource sharing response header that allows cross-domain access and sent to the front-end, followed by:
[0120] When the area is switched successfully and the user accesses the function through the front-end, the legitimacy of the user is verified according to the access whitelist;
[0121] In response to the function information, the domain name of the front-end address is added to the cross-origin resource sharing response header that allows cross-origin access;
[0122] A cross-origin resource sharing response header that allows cross-origin access is sent to the front end, which is used by the front end to load function information from the target service area to the page.
[0123] Preferably, when the domain name of the user's current browser address is www.cn.com and the domain name of the target service area is www.us.com, when the user clicks on the function of the target service area through the front end, a request header carrying the value of the cross-domain resource sharing response header token that allows cross-domain access is sent to the target service area, and the domain name sent by the user through the front end is received. When the source request domain is allowed to access, the function information is responded to, and the domain name www.cn.com of the source request domain is placed in the cross-domain resource sharing response header that allows cross-domain access, and is transmitted to the front end. The front end receives the response header with www.cn.com, and the browser will normally parse and render the page to display the function information accessed by the user. At this time, the browser address is still www.cn.com, but the content loaded in the page comes from the domain name www.us.com returned.
[0124] In some embodiments, verifying the legitimacy of the user according to the access whitelist includes:
[0125] Verify the legitimacy of the value of the user token and the user's Internet address in the whitelist. If both are verified and matched, respond with function information.
[0126] In some embodiments, the user identity verification and encryption signature are performed by the current service area, including:
[0127] In the current service area, the public key of the target service area is used to encrypt the token identity information to generate an encrypted string; in the current service area, the private key of the current service area is used to encrypt the encrypted string to generate an information signature.
[0128] In some embodiments, the encrypted token identity information and information signature are verified and decrypted, including:
[0129] After verifying the information signature using the public key of the current service area, the encrypted token identity information is decrypted using the private key of the target service area.
[0130] Preferably, the information signature is verified by means of a public key to obtain an encrypted string generated in the current service area, and the user token information randomly generated by the server is obtained by decrypting the string.
[0131] In some embodiments, generating an access whitelist further includes:
[0132] By decrypting in the target service area, the target service area obtains the token identity information, and the token identity information is used to verify the validity period of the timestamp. If the verified timestamp is within the validity period, the user token and user Internet address will be generated into an access whitelist.
[0133] Preferably, when the target service area generates an access whitelist, the verified token identity information is stored in the server for information verification when accessing again, and a response switching success message and the token value are displayed.
[0134] In this embodiment, if Figure 1 and Figure 3 As shown, the present invention constructs a token cross-region exchange and authentication method, which is applied to the current service area and includes the following steps:
[0135] Receive a region switching request sent by the front end when the user accesses the front end;
[0136] Verify the user identity information of the area switching request;
[0137] Encrypt token identity information and generate information signature;
[0138] The encrypted token identity information and information signature are sent to the front end. The encrypted token identity information and information signature are used by the front end to send to the target service area for signature verification and decryption, and generate an access whitelist. The target service area adds the domain name of the front end address to the cross-domain resource sharing response header that allows cross-domain access, and sends the cross-domain resource sharing response header that allows cross-domain access to the front end, so that the front end can load the content from the target service area to the page.
[0139] Before users switch areas to access, they need to register and log in to their account.
[0140] Preferably, after generating the encrypted token identity information and information signature, the address of the source request domain will be added to the cross-domain resource sharing response header that allows cross-domain access in the current service area, and then the encrypted token identity information and information signature will be sent to the front end.
[0141] Preferably, when the domain name of the user's current browser address is www.cn.com and the domain name of the target service area is www.us.com, the target service area receives the domain name sent by the user through the front end. When the source request domain is allowed to access, the domain name www.cn.com of the source request domain is placed in the cross-domain resource sharing response header that allows cross-domain access in the target service area, and transmitted to the front end. The front end receives the response header with www.cn.com, and the browser will normally parse and render the page to show that the area switching is successful. At this time, the browser address is still www.cn.com, but the content loaded in the page comes from the domain name www.us.com returned, and the value of the token will be cached in the front end. When access is made, the token will be brought back to the target service area for authorization and legality verification.
[0142] Among them, cross-origin resource sharing is to add a set of HTTP header fields to allow the service to declare what resources the origin station has permission to access. By adding a set of newly added HTTP header fields to the response header of the response message, the front-end browser automatically recognizes that cross-origin data loading is allowed.
[0143] In some embodiments, the token identity information includes the value of the access token, the Internet address of the accessor, and a timestamp.
[0144] Preferably, after the area switching is successful and the user accesses the target service area through the front end, the target service area verifies the legitimacy of the user according to the access whitelist, and responds to the function information, adds the domain name of the front end address to the cross-domain resource sharing response header that allows cross-domain access, and sends the cross-domain resource sharing response header that allows cross-domain access to the front end, so that the front end can load the function information from the target service area to the page.
[0145] Verify the legitimacy of the user token value and the user's Internet address in the whitelist. If both are verified and matched, respond with function information.
[0146] Preferably, when the domain name of the user's current browser address is www.cn.com and the domain name of the target service area is www.us.com, when the user clicks on the function of the target service area through the front end, a request header carrying the value of the cross-domain resource sharing response header token that allows cross-domain access is sent to the target service area, and the domain name sent by the user through the front end is received. When the source request domain is allowed to access, the function information is responded to, and the domain name www.cn.com of the source request domain is placed in the cross-domain resource sharing response header that allows cross-domain access, and is transmitted to the front end. The front end receives the response header with www.cn.com, and the browser will normally parse and render the page to display the function information accessed by the user. At this time, the browser address is still www.cn.com, but the content loaded in the page comes from the domain name www.us.com returned.
[0147] In some embodiments, encrypting the token identity information and generating a signature for the information includes:
[0148] The token identity information is combined and encrypted using the public key of the target service area to generate an encrypted string; and the encrypted string is encrypted using the private key of the current service area to generate an information signature.
[0149] In some embodiments, the encrypted token identity information and information signature are sent by the front end to the target service area for signature verification and decryption, including:
[0150] In the target service area, the public key of the current service area is used to verify the information signature, and then the encrypted token identity information is decrypted using the private key of the target service area.
[0151] Preferably, the information signature is verified by means of a public key to obtain an encrypted string generated in the current service area, and the user token information randomly generated by the server is obtained by decrypting the string.
[0152] In some embodiments, generating an access whitelist further includes:
[0153] By decrypting in the target service area, the target service area obtains the token identity information and verifies the validity period of the timestamp in the token identity information. The validity period of the verification timestamp is used to trigger that when the verification timestamp is within the validity period, the user token and user Internet address are added to the access whitelist.
[0154] Preferably, when the target service area generates an access whitelist, the verified token identity information is stored in the server for information verification when accessing again, and a response switching success message and the token value are displayed.
[0155] In this embodiment, if Figure 1 and Figure 4 As shown, the present invention constructs a token cross-region exchange and authentication method, which is applied to the front end and includes the following steps:
[0156] Send the switching area request triggered by the user access to the current service area. The user identity information in the switching request is used by the current service area to verify the user identity information and perform encryption and signature to generate encrypted token identity information and information signature;
[0157] Receive the encrypted token identity information and information signature sent by the current service area;
[0158] Send the encrypted token identity information and information signature to the target service area for signature verification and decryption, and generate an access whitelist. The target service area adds the domain name of the front-end address to the cross-domain resource sharing response header that allows cross-domain access.
[0159] Receive a cross-origin resource sharing response header that allows cross-origin access and load content from the target service area into the page.
[0160] Before users switch areas to access, they need to register and log in to their account.
[0161] Preferably, after generating the encrypted token identity information and information signature, the address of the source request domain will be added to the cross-domain resource sharing response header that allows cross-domain access in the current service area, and then the encrypted token identity information and information signature will be sent to the front end.
[0162] Preferably, when the domain name of the user's current browser address is www.cn.com and the domain name of the target service area is www.us.com, the target service area receives the domain name sent by the user through the front end. When the source request domain is allowed to access, the domain name www.cn.com of the source request domain is placed in the cross-domain resource sharing response header that allows cross-domain access in the target service area, and transmitted to the front end. The front end receives the response header with www.cn.com, and the browser will normally parse and render the page to show that the area switching is successful. At this time, the browser address is still www.cn.com, but the content loaded in the page comes from the domain name www.us.com returned, and the value of the token will be cached in the front end. When access is made, the token will be brought back to the target service area for authorization and legality verification.
[0163] Among them, cross-origin resource sharing is to add a set of HTTP header fields to allow the service to declare what resources the origin station has permission to access. By adding a set of newly added HTTP header fields to the response header of the response message, the front-end browser automatically recognizes that cross-origin data loading is allowed.
[0164] In some embodiments, the token identity information includes the value of the access token, the Internet address of the accessor, and a timestamp.
[0165] In some embodiments, receiving a cross-origin resource sharing response header that allows cross-origin access further comprises:
[0166] After the region is successfully switched, the function of accessing the target service area is used. The target service area verifies the legitimacy of the user according to the access whitelist, responds to the function information, and adds the domain name of the front-end address to the cross-domain resource sharing response header that allows cross-domain access;
[0167] A cross-origin resource sharing response header allowing cross-origin access is received from the target service area, and is used to load function information from the target service area to the page.
[0168] Preferably, when the domain name of the user's current browser address is www.cn.com and the domain name of the target service area is www.us.com, when the user clicks on the function of the target service area through the front end, a request header carrying the value of the cross-domain resource sharing response header token that allows cross-domain access is sent to the target service area, and the domain name sent by the user through the front end is received. When the source request domain is allowed to access, the function information is responded to, and the domain name www.cn.com of the source request domain is placed in the cross-domain resource sharing response header that allows cross-domain access, and is transmitted to the front end. The front end receives the response header with www.cn.com, and the browser will normally parse and render the page to display the function information accessed by the user. At this time, the browser address is still www.cn.com, but the content loaded in the page comes from the domain name www.us.com returned.
[0169] In some embodiments, verifying the legitimacy of the user according to the access whitelist includes:
[0170] Verify the legitimacy of the value of the user token and the user's Internet address in the whitelist. If both are verified and matched, respond with functional information.
[0171] In some embodiments, the current service area verifies the token identity information and performs encryption and signature to generate encrypted token identity information and information signature, including:
[0172] The token identity information is combined in the current service area, and the encrypted string is generated using the public key of the target service area; the encrypted string is encrypted in the current service area using the private key of the current service area to generate an information signature.
[0173] In some embodiments, sending the encrypted token identity information and information signature to the target service area for the target service area to verify and decrypt the signature includes:
[0174] After verifying the information signature in the target service area using the public key of the current service area, the encrypted token identity information is decrypted using the private key of the target service area.
[0175] Preferably, the information signature is verified by using a public key to obtain an encrypted string generated in the current service area, and the user token information randomly generated by the server is obtained by decrypting the string.
[0176] In some embodiments, generating an access whitelist further includes:
[0177] By decrypting in the target service area, the target service area obtains the token identity information, and the token identity information is used to verify the validity period of the timestamp. If the verified timestamp is within the validity period, the user token and user Internet address will be generated into an access whitelist.
[0178] Preferably, when the target service area generates an access whitelist, the verified token identity information is stored in the server for information verification when accessing again, and a response switching success message and the token value are displayed.
[0179] In this embodiment, if Figure 5 As shown, the present invention constructs a token cross-region exchange and authentication system, which is applied to the target service area, including:
[0180] The first receiving module is used to receive the encrypted token identity information and information signature sent by the front end. The encrypted token identity information and information signature are sent to the front end after the user sends a switching area request to the current service area through the front end when accessing the front end, and then the current service area performs user identity verification and encryption signature.
[0181] The signature verification and decryption module is used to verify and decrypt the encrypted token identity information and information signature, and generate an access whitelist;
[0182] The first processing module is used to add the domain name of the front-end address to a cross-domain resource sharing response header that allows cross-domain access, and send it to the front-end for the front-end to load the content from the target service area to the page.
[0183] Before users switch areas to access, they need to register and log in to their account.
[0184] Preferably, after generating the encrypted token identity information and information signature, the address of the source request domain will be added to the cross-domain resource sharing response header that allows cross-domain access in the current service area, and then the encrypted token identity information and information signature will be sent to the front end.
[0185] Preferably, when the domain name of the user's current browser address is www.cn.com and the domain name of the target service area is www.us.com, the domain name sent by the user through the front end is received. When the source request domain is allowed to access, the domain name www.cn.com of the source request domain is placed in the cross-domain resource sharing response header that allows cross-domain access and transmitted to the front end. The front end receives the response header with www.cn.com, and the browser will normally parse and render the page to show that the area switching is successful. At this time, the browser address is still www.cn.com, but the content loaded in the page comes from the domain name www.us.com returned, and the value of the token will be cached in the front end. When access is made, the token will be brought back to the target service area for authorization and legality verification.
[0186] Among them, cross-origin resource sharing is to add a set of HTTP header fields to allow the service to declare what resources the origin station has permission to access. By adding a set of newly added HTTP header fields to the response header of the response message, the front-end browser automatically recognizes that cross-origin data loading is allowed.
[0187] In some embodiments, the token identity information includes the value of the access token, the Internet address of the accessor, and a timestamp.
[0188] In some embodiments, the system further comprises:
[0189] The first verification module is used to verify the legitimacy of the user according to the access whitelist when the area is successfully switched and the user accesses the function through the front end;
[0190] The second processing module is used to respond to the function information and add the domain name of the front-end address to the cross-domain resource sharing response header that allows cross-domain access;
[0191] The first sending module is used to send a cross-domain resource sharing response header that allows cross-domain access to the front end, so that the front end loads the function information from the target service area to the page.
[0192] Preferably, when the domain name of the user's current browser address is www.cn.com and the domain name of the target service area is www.us.com, when the user clicks on the function of the target service area through the front end, a request header carrying the value of the cross-domain resource sharing response header token that allows cross-domain access is sent to the target service area, and the domain name sent by the user through the front end is received. When the source request domain is allowed to access, the function information is responded to, and the domain name www.cn.com of the source request domain is placed in the cross-domain resource sharing response header that allows cross-domain access, and is transmitted to the front end. The front end receives the response header with www.cn.com, and the browser will normally parse and render the page to display the function information accessed by the user. At this time, the browser address is still www.cn.com, but the content loaded in the page comes from the domain name www.us.com returned.
[0193] In some embodiments, the system includes:
[0194] Verify the legitimacy of the value of the user token and the user's Internet address in the whitelist. If both are verified and matched, respond with functional information.
[0195] In some embodiments, the system includes:
[0196] In the current service area, the public key of the target service area is used to encrypt the token identity information to generate an encrypted string; in the current service area, the private key of the current service area is used to encrypt the encrypted string to generate an information signature.
[0197] In some embodiments, the system includes:
[0198] After verifying the information signature using the public key of the current service area, the encrypted token identity information is decrypted using the private key of the target service area.
[0199] Preferably, the information signature is verified by using a public key to obtain an encrypted string generated in the current service area, and the user token information randomly generated by the server is obtained by decrypting the string.
[0200] In some embodiments, the system further comprises:
[0201] The validity period of the timestamp in the token identity information is verified. If the verification timestamp is within the validity period, the user token and the user's Internet address are generated into an access whitelist.
[0202] Preferably, when the target service area generates an access whitelist, the verified token identity information is stored in the server for information verification when accessing again, and a response switching success message and the token value are displayed.
[0203] In this embodiment, if Figure 6As shown, the present invention constructs a token cross-region exchange and authentication system, which is applied to the current service area, including:
[0204] A second receiving module is used to receive a switching area request sent by the front end when the user accesses the front end;
[0205] A second verification module is used to verify the user identity information of the area switching request;
[0206] An encryption module, used to encrypt token identity information and generate information signature;
[0207] The second sending module is used to send the encrypted token identity information and information signature to the front end. The encrypted token identity information and information signature are used by the front end to send to the target service area for signature verification and decryption, and generate an access whitelist. The target service area adds the domain name of the front end address to the cross-domain resource sharing response header that allows cross-domain access, and sends the cross-domain resource sharing response header that allows cross-domain access to the front end, so that the front end can load the content from the target service area to the page.
[0208] Before users switch areas to access, they need to register and log in to their account.
[0209] Preferably, after generating the encrypted token identity information and information signature, the address of the source request domain will be added to the cross-domain resource sharing response header that allows cross-domain access in the current service area, and then the encrypted token identity information and information signature will be sent to the front end.
[0210] Preferably, when the domain name of the user's current browser address is www.cn.com and the domain name of the target service area is www.us.com, the target service area receives the domain name sent by the user through the front end. When the source request domain is allowed to access, the domain name www.cn.com of the source request domain is placed in the cross-domain resource sharing response header that allows cross-domain access in the target service area, and transmitted to the front end. The front end receives the response header with www.cn.com, and the browser will normally parse and render the page to show that the area switching is successful. At this time, the browser address is still www.cn.com, but the content loaded in the page comes from the domain name www.us.com returned, and the value of the token will be cached in the front end. When access is made, the token will be brought back to the target service area for authorization and legality verification.
[0211] Among them, cross-origin resource sharing is to add a set of HTTP header fields to allow the service to declare what resources the origin station has permission to access. By adding a set of newly added HTTP header fields to the response header of the response message, the front-end browser automatically recognizes that cross-origin data loading is allowed.
[0212] In some embodiments, the token identity information includes the value of the access token, the Internet address of the accessor, and a timestamp.
[0213] Preferably, after the area switching is successful and the user accesses the target service area through the front end, the target service area verifies the legitimacy of the user according to the access whitelist, and responds to the function information, adds the domain name of the front end address to the cross-domain resource sharing response header that allows cross-domain access, and sends the cross-domain resource sharing response header that allows cross-domain access to the front end, so that the front end can load the function information from the target service area to the page.
[0214] Verify the legitimacy of the user token value and the user's Internet address in the whitelist. If both are verified and matched, respond with function information.
[0215] Preferably, when the domain name of the user's current browser address is www.cn.com and the domain name of the target service area is www.us.com, when the user clicks on the function of the target service area through the front end, a request header carrying the value of the cross-domain resource sharing response header token that allows cross-domain access is sent to the target service area, and the domain name sent by the user through the front end is received. When the source request domain is allowed to access, the function information is responded to, and the domain name www.cn.com of the source request domain is placed in the cross-domain resource sharing response header that allows cross-domain access, and is transmitted to the front end. The front end receives the response header with www.cn.com, and the browser will normally parse and render the page to display the function information accessed by the user. At this time, the browser address is still www.cn.com, but the content loaded in the page comes from the domain name www.us.com returned.
[0216] In some embodiments, the system includes:
[0217] The token identity information is combined and encrypted using the public key of the target service area to generate an encrypted string; and the encrypted string is encrypted using the private key of the current service area to generate an information signature.
[0218] In some embodiments, the system includes:
[0219] In the target service area, the public key of the current service area is used to verify the information signature, and then the encrypted token identity information is decrypted using the private key of the target service area.
[0220] Preferably, the information signature is verified by means of a public key to obtain an encrypted string generated in the current service area, and the user token information randomly generated by the server is obtained by decrypting the string.
[0221] In some embodiments, the system further comprises:
[0222] By decrypting in the target service area, the target service area obtains the token identity information and verifies the validity period of the timestamp in the token identity information. The validity period of the verification timestamp is used to trigger that when the verification timestamp is within the validity period, the user token and user Internet address are added to the access whitelist.
[0223] Preferably, when the target service area generates an access whitelist, the verified token identity information is stored in the server for information verification when accessing again, and a response switching success message and the token value are displayed.
[0224] In this embodiment, if Figure 7 As shown, the present invention constructs a token cross-region exchange and authentication system, which is applied to the front end and includes:
[0225] The third sending module is used to send the switching area request triggered by the user access to the current service area. The user identity information in the switching request is used by the current service area to verify the user identity information and perform encryption and signature to generate encrypted token identity information and information signature;
[0226] A third receiving module, used to receive the encrypted token identity information and information signature sent by the current service area;
[0227] The fourth sending module is used to send the encrypted token identity information and information signature to the target service area, so that the target service area can verify and decrypt the signature and generate an access whitelist. The target service area adds the domain name of the front-end address to the cross-domain resource sharing response header that allows cross-domain access.
[0228] The fourth receiving module is used to receive a cross-domain resource sharing response header that allows cross-domain access, and load the content from the target service area to the page.
[0229] Before users switch areas to access, they need to register and log in to their account.
[0230] Preferably, after generating the encrypted token identity information and information signature, the address of the source request domain will be added to the cross-domain resource sharing response header that allows cross-domain access in the current service area, and then the encrypted token identity information and information signature will be sent to the front end.
[0231] Preferably, when the domain name of the user's current browser address is www.cn.com and the domain name of the target service area is www.us.com, the target service area receives the domain name sent by the user through the front end. When the source request domain is allowed to access, the domain name www.cn.com of the source request domain is placed in the cross-domain resource sharing response header that allows cross-domain access in the target service area, and transmitted to the front end. The front end receives the response header with www.cn.com, and the browser will normally parse and render the page to show that the area switching is successful. At this time, the browser address is still www.cn.com, but the content loaded in the page comes from the domain name www.us.com returned, and the value of the token will be cached in the front end. When access is made, the token will be brought back to the target service area for authorization and legality verification.
[0232] Among them, cross-origin resource sharing is to add a set of HTTP header fields to allow the service to declare what resources the origin station has permission to access. By adding a set of newly added HTTP header fields to the response header of the response message, the front-end browser automatically recognizes that cross-origin data loading is allowed.
[0233] In some embodiments, the token identity information includes the value of the access token, the Internet address of the accessor, and a timestamp.
[0234] In some embodiments, the system further comprises:
[0235] The third processing module is used for accessing the function of the target service area after the area switching is successful, and the target service area verifies the legitimacy of the user according to the access whitelist, and responds to the function information, and adds the domain name of the front-end address to the cross-domain resource sharing response header that allows cross-domain access;
[0236] The fifth receiving module is used to receive a cross-domain resource sharing response header that allows cross-domain access and is sent by the target service area, and is used to load the function information from the target service area to the page.
[0237] Preferably, when the domain name of the user's current browser address is www.cn.com and the domain name of the target service area is www.us.com, when the user clicks on the function of the target service area through the front end, a request header carrying the value of the cross-domain resource sharing response header token that allows cross-domain access is sent to the target service area, and the domain name sent by the user through the front end is received. When the source request domain is allowed to access, the function information is responded to, and the domain name www.cn.com of the source request domain is placed in the cross-domain resource sharing response header that allows cross-domain access, and is transmitted to the front end. The front end receives the response header with www.cn.com, and the browser will normally parse and render the page to display the function information accessed by the user. At this time, the browser address is still www.cn.com, but the content loaded in the page comes from the domain name www.us.com returned.
[0238] In some embodiments, the system includes:
[0239] Verify the legitimacy of the value of the user token and the user's Internet address in the whitelist. If both are verified and matched, respond with functional information.
[0240] In some embodiments, the system includes:
[0241] The token identity information is combined in the current service area, and the encrypted string is generated using the public key of the target service area; the encrypted string is encrypted in the current service area using the private key of the current service area to generate an information signature.
[0242] In some embodiments, the system includes:
[0243] The public key is used to verify the information signature in the target service area and then decrypt the encrypted token identity information.
[0244] Preferably, the information signature is verified by using a public key to obtain an encrypted string generated in the current service area, and the user token information randomly generated by the server is obtained by decrypting the string.
[0245] In some embodiments, the system further comprises:
[0246] By decrypting in the target service area, the target service area obtains the token identity information, and the token identity information is used to verify the validity period of the timestamp. If the verified timestamp is within the validity period, the user token and user Internet address will be generated into an access whitelist.
[0247] Preferably, when the target service area generates an access whitelist, the verified token identity information is stored in the server for information verification when accessing again, and a response switching success message and the token value are displayed.
[0248] By implementing the present invention, the following beneficial effects are achieved:
[0249] The user sends a request to switch regions through the front end, verifies the user identity in the current service area, encrypts the user's identity information and generates an information signature, and then sends the encrypted token identity information and information signature to the front end, which is sent to the target service area through the front end for signature verification and decryption, generates an access whitelist in the target service area and adds the source domain to the cross-domain resource sharing response header that allows cross-domain access, and then sends the cross-domain resource sharing response header that allows cross-domain access to the front end, and displays the cross-domain switching success in the front end. After the switch is successful, when the user selects the function of the target area according to the front end, the target service area verifies the legitimacy of the user identity in the whitelist, thereby responding to the function information, adding the domain name containing the source domain to the cross-domain resource sharing response header that allows cross-domain access and transmitting it to the front end, and the browser in the front end parses and renders the page normally to display the function information accessed by the user. By implementing the present invention, there is no need to synchronize tokens between data centers in different regions during cross-domain access, which reduces the frequent interaction between data centers, and different regional data centers will not store user information registered in non-regions.
[0250] It can be understood that the above embodiments only express the preferred implementation modes of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the patent scope of the present invention. It should be pointed out that, for ordinary technicians in this field, the above technical features can be freely combined without departing from the concept of the present invention, and several deformations and improvements can be made, which all belong to the protection scope of the present invention. Therefore, all equivalent changes and modifications made to the scope of the claims of the present invention should belong to the coverage of the claims of the present invention.
Claims
1. A token cross-region exchange and authentication method, characterized in that: Applied to a target service area, the method comprises: Receive the encrypted token identity information and information signature sent by the front end, wherein the encrypted token identity information and information signature are sent to the front end after the user accesses the front end and the front end sends a switching area request to the current service area, and then the current service area performs user identity verification and encryption signature; Verify and decrypt the encrypted token identity information and information signature, and generate an access whitelist; The domain name of the front-end address is added to a cross-domain resource sharing response header that allows cross-domain access, and sent to the front-end, so that the front-end loads the content from the target service area to the page, and then further includes: When the area is switched successfully and the user accesses a function through the front end, the legitimacy of the user is verified according to the access whitelist; In response to the function information, the domain name of the front-end address is added to the cross-domain resource sharing response header that allows cross-domain access; The cross-domain resource sharing response header allowing cross-domain access is sent to the front end, so that the front end loads the function information from the target service area to the page.
2. The token cross-region exchange and authentication method according to claim 1, characterized in that: The token identity information includes the value of the access token, the Internet address of the switching visitor and a timestamp.
3. The token cross-region exchange and authentication method according to claim 1, characterized in that: Verify the legitimacy of the user according to the access whitelist, including: Verify the legitimacy of the value of the user token in the whitelist and the user's Internet address.
4. The token cross-region exchange and authentication method according to claim 1, characterized in that: The current service area performs user identity verification and encryption signature, including: The token identity information is combined and encrypted in the current service area using the public key of the target service area to generate an encrypted string; and the encrypted string is encrypted in the current service area using the private key of the current service area to generate the information signature.
5. The token cross-region exchange and authentication method according to claim 1, characterized in that: The encrypted token identity information and information signature are verified and decrypted, including: After verifying the signature of the information using the public key of the current service area, the encrypted token identity information is decrypted using the private key of the target service area.
6. The token cross-region exchange and authentication method according to claim 2, characterized in that: Generate an access whitelist, which previously included: The validity period of the timestamp in the token identity information is verified, and if the timestamp is verified to be within the validity period, the user token and the user Internet address are used to generate the access whitelist.
7. A token cross-region exchange and authentication method, characterized in that: Applied to the current service area, the method includes: receiving a region switching request sent by a user through the front end when the user accesses the front end; Verifying user identity information of the area switching request; Encrypt token identity information and generate information signature; Send the encrypted token identity information and the information signature to the front end, the encrypted token identity information and the information signature are used by the front end to send to the target service area for signature verification and decryption, and generate an access whitelist, the target service area adds the domain name of the front end address to the cross-domain resource sharing response header that allows cross-domain access, and sends the cross-domain resource sharing response header that allows cross-domain access to the front end, so that the front end loads the content from the target service area to the page, and then also includes: When the area is switched successfully and the user accesses a function through the front end, the legitimacy of the user is verified according to the access whitelist; In response to the function information, the target service area adds the domain name of the front-end address to a cross-domain resource sharing response header that allows cross-domain access; and sends the cross-domain resource sharing response header that allows cross-domain access to the front-end, so that the front-end loads the function information from the target service area to the page.
8. The token cross-region exchange and authentication method according to claim 7, characterized in that: The token identity information includes the value of the access token, the Internet address of the switching visitor and a timestamp.
9. The token cross-region exchange and authentication method according to claim 7, characterized in that: Encrypting the token identity information and generating a message signature includes: The token identity information is combined and encrypted using the public key of the target service area to generate an encrypted string; and the encrypted string is encrypted using the private key of the current service area to generate the information signature.
10. The token cross-region exchange and authentication method according to claim 7, characterized in that: The encrypted token identity information and information signature are sent by the front end to the target service area for signature verification and decryption, including: The information signature is verified in the target service area using the public key of the current service area and then the encrypted token identity information is decrypted using the private key of the target service area.
11. The token cross-region exchange and authentication method according to claim 8, characterized in that: Generate an access whitelist, which previously included: The decryption enables the target service area to obtain the token identity information, verify the validity period of the timestamp in the token identity information, and verify the validity period of the timestamp to trigger the addition of the user token and the user Internet address to the access whitelist when the verified timestamp is within the validity period.
12. A token cross-region exchange and authentication method, characterized in that: Applied to the front end, the method includes: Sending a switching area request triggered by user access to the current service area, wherein the user identity information in the switching area request is used by the current service area to verify the user identity information and perform encryption and signature to generate the encrypted token identity information and information signature; Receiving the encrypted token identity information and information signature sent by the current service area; Send the encrypted token identity information and information signature to the target service area for the target service area to verify and decrypt the signature and generate an access whitelist. The target service area adds the domain name of the front-end address to the cross-domain resource sharing response header that allows cross-domain access. Receiving the cross-domain resource sharing response header that allows cross-domain access, loading the content from the target service area to the page, and then further comprising: A function for accessing a target service area after the area switching is successful, wherein the target service area verifies the legitimacy of the user according to the access whitelist, and responds to the function information by adding the domain name of the front-end address to a cross-domain resource sharing response header that allows cross-domain access; The cross-domain resource sharing response header allowing cross-domain access sent by the target service area is received, and is used to load the function information from the target service area to the page.
13. The token cross-region exchange and authentication method according to claim 12, characterized in that: The token identity information includes the value of the access token, the Internet address of the switching visitor and a timestamp.
14. The token cross-region exchange and authentication method according to claim 12, characterized in that: Verifying the legitimacy of the user according to the access whitelist includes: Verify the legitimacy of the value of the user token in the whitelist and the user's Internet address.
15. The token cross-region exchange and authentication method according to claim 12, characterized in that: The current service area verifies the user identity information and performs encryption and signature to generate the encrypted token identity information and information signature, including: The token identity information is combined in the current service area, and encrypted using the public key of the target service area to generate an encrypted string; and the encrypted string is encrypted using the private key of the current service area in the current service area to generate the information signature.
16. The token cross-region exchange and authentication method according to claim 12, characterized in that: Sending the encrypted token identity information and information signature to the target service area for signature verification and decryption in the target service area includes: After verifying the signature of the information in the target service area using the public key of the current service area, the encrypted token identity information is decrypted using the private key of the target service area.
17. The token cross-region exchange and authentication method according to claim 13, characterized in that: Generate an access whitelist, which previously included: The decryption enables the target service area to obtain the token identity information within the target service area. The token identity information is used to verify the validity period of the timestamp. If the timestamp is within the validity period, the user token and the user Internet address are used to generate the access whitelist.
18. A token cross-region exchange and authentication system, characterized in that: Applicable to the target service area, including: A first receiving module is used to receive the encrypted token identity information and information signature sent by the front end, wherein the encrypted token identity information and information signature are sent to the front end after the user accesses the front end and the front end sends a switching area request to the current service area, and then the current service area performs user identity verification and encryption signature; A signature verification and decryption module, used to verify and decrypt the encrypted token identity information and information signature, and generate an access whitelist; A first processing module, configured to add the domain name of the front-end address to a cross-domain resource sharing response header that allows cross-domain access, and send the domain name to the front-end, so that the front-end loads the content from the target service area to the page; The system also includes: A first verification module is used to verify the legitimacy of the user according to the access whitelist when the area is successfully switched and the user accesses the function through the front end; A second processing module is used to respond to the function information and add the domain name of the front-end address to a cross-domain resource sharing response header that allows cross-domain access; The first sending module is used to send the cross-domain resource sharing response header that allows cross-domain access to the front end, so that the front end loads the function information from the target service area to the page.
19. The token cross-region exchange and authentication system according to claim 18, characterized in that: The token identity information includes the value of the access token, the Internet address of the switching visitor and a timestamp.
20. The token cross-region exchange and authentication system according to claim 18, characterized in that: The system includes: Verify the legitimacy of the value of the user token in the whitelist and the user's Internet address.
21. The token cross-region exchange and authentication system according to claim 18, characterized in that: The system includes: In the current service area, the token identity information is combined and encrypted using the public key of the target service area to generate an encrypted string; The encrypted character string is encrypted in the current service area using the private key of the current service area to generate the information signature.
22. The token cross-region exchange and authentication system according to claim 18, characterized in that: The system includes: After verifying the signature of the information using the public key of the current service area, the encrypted token identity information is decrypted using the private key of the target service area.
23. The token cross-region exchange and authentication system according to claim 19, characterized in that: The system also includes: The validity period of the timestamp in the token identity information is verified, and if the timestamp is verified to be within the validity period, the user token and the user Internet address are used to generate the access whitelist.
24. A token cross-region exchange and authentication system, characterized in that: Applicable to the current service area, including: A second receiving module, used for receiving a switching area request sent by the front end when a user accesses the front end; A second verification module, used to verify the user identity information of the switching area request; An encryption module, used to encrypt token identity information and generate information signature; A second sending module is used to send the encrypted token identity information and the information signature to the front end, the encrypted token identity information and the information signature are used by the front end to send to the target service area for signature verification and decryption, and generate an access whitelist, the target service area adds the domain name of the front end address to the cross-domain resource sharing response header that allows cross-domain access, and sends the cross-domain resource sharing response header that allows cross-domain access to the front end, so that the front end loads the content from the target service area to the page; The system further comprises: A fourth verification module, used to verify the legitimacy of the user according to the access whitelist when the area is successfully switched and the user accesses the function through the front end; A fourth processing module, used for responding to the function information, adding the domain name of the front-end address to a cross-domain resource sharing response header that allows cross-domain access; The fifth sending module is used to send the cross-domain resource sharing response header that allows cross-domain access to the front end, so that the front end loads the function information from the target service area to the page.
25. The token cross-region exchange and authentication system according to claim 24, characterized in that: The token identity information includes the value of the access token, the Internet address of the switching visitor and a timestamp.
26. The token cross-region exchange and authentication system according to claim 24, characterized in that: The system includes: By combining the token identity information, an encrypted string is generated using the public key encryption of the target service area; The encrypted character string is encrypted using the private key of the current service area to generate the information signature.
27. The token cross-region exchange and authentication system according to claim 24, characterized in that: The system includes: The information signature is verified in the target service area using the public key of the current service area and then the encrypted token identity information is decrypted using the private key of the target service area.
28. The token cross-region exchange and authentication system according to claim 25, characterized in that: The system also includes: The decryption enables the target service area to obtain the token identity information, verify the validity period of the timestamp in the token identity information, and verify the validity period of the timestamp to trigger the addition of the user token and the user Internet address to the access whitelist when the timestamp is within the validity period.
29. A token cross-region exchange and authentication system, characterized in that: Applied to the front end, including: A third sending module is used to send a switching area request triggered by user access to the current service area, and the user identity information in the switching area request is used by the current service area to verify the user identity information and perform encryption and signature to generate encrypted token identity information and information signature; A third receiving module, configured to receive the encrypted token identity information and information signature sent by the current service area; A fourth sending module is used to send the encrypted token identity information and information signature to the target service area, so that the target service area can verify and decrypt the signature and generate an access whitelist. The target service area adds the domain name of the front-end address to the cross-domain resource sharing response header that allows cross-domain access. A fourth receiving module is used to receive the cross-domain resource sharing response header that allows cross-domain access, and load the content from the target service area to the page; The system also includes: A third processing module is used for accessing the function of the target service area after the area switching is successful, and for the target service area to verify the legitimacy of the user according to the access whitelist, and respond to the function information by adding the domain name of the front-end address to the cross-domain resource sharing response header that allows cross-domain access; The fifth receiving module is used to receive the cross-domain resource sharing response header allowing cross-domain access sent by the target service area, and is used to load the function information from the target service area to the page.
30. The token cross-region exchange and authentication system according to claim 29, characterized in that: The token identity information includes the value of the access token, the Internet address of the switching visitor and a timestamp.
31. The token cross-region exchange and authentication system according to claim 29, characterized in that: The system includes: Verify the legitimacy of user tokens and user Internet addresses in the whitelist.
32. The token cross-region exchange and authentication system according to claim 29, characterized in that: The system includes: Combining the token identity information in the current service area and encrypting it using the public key of the target service area to generate an encrypted string; The encrypted character string is encrypted in the current service area using the private key of the current service area to generate the information signature.
33. The token cross-region exchange and authentication system according to claim 29, characterized in that: The system includes: After verifying the signature of the information in the target service area using the public key of the current service area, the encrypted token identity information is decrypted using the private key of the target service area.
34. The token cross-region exchange and authentication system according to claim 30, characterized in that: The system also includes: The decryption enables the target service area to obtain the token identity information within the target service area. The token identity information is used to verify the validity period of the timestamp. If the timestamp is within the validity period, the user token and the user Internet address are used to generate the access whitelist.
