Keyblock-based Huawei cloud secondary login-free method and apparatus, and medium
Through the integration of Keycloak and Huawei Cloud Platform, Access Token is used to achieve single sign-on, which solves the problem of multiple user logins and token storage dependency in the cloud computing environment, improves login efficiency and system stability, and reduces operation and maintenance costs.
Patent Information
- Application Number
- CN202411290586.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-14
- Publication Date
- 2024-10-18
AI Technical Summary
The existing technology lacks an effective single sign-on method in the cloud computing environment, resulting in users needing to log in multiple times, which increases operation and maintenance costs. Moreover, it cannot support login to Huawei Cloud Platform and relies on third-party services to store token information, which increases system instability. .
Use Keycloak as the authentication service to avoid secondary login through the authentication interface of Huawei Cloud Platform. Use Code to exchange Access Token with Huawei Cloud, and store and verify the Token inside Keycloak to avoid repeated login and reduce dependence on third-party services. .
It enables users to access other integrated systems after logging in to one system, simplifying the login process, reducing user registration requirements and management costs, and reducing system risks and operation and maintenance costs.
Smart Images

Figure CN118802384A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of software management technology and software management system, and specifically relates to a HUAWEI CLOUD secondary login-free method, device and medium based on Keycloak. Background Art
[0002] With the rise of cloud computing, more and more enterprises are turning to cloud deployment and use of software services to reduce costs, improve flexibility and expand business scope. After entering the Huawei Cloud Marketplace, users of the Huawei Cloud Marketplace need to be introduced into enterprise products as product users. Enterprise products also include various sub-application systems. Users of the Huawei Cloud Application Marketplace only need to log in once to access all mutually trusted application systems of the enterprise, and multiple application systems can obtain corresponding user information.
[0003] The existing technology currently has the following defects: First, the existing technology only provides a single sign-on method based on token verification, and the token information needs to rely on the third-party service Redis (a database with memory data structure) for storage. The introduction of third-party services increases the instability of the system and increases the operation and maintenance costs. Each time the token is verified, it is necessary to connect to Redis for query, which increases the network request and response time. Secondly, the existing technology does not support login to other cloud platforms (such as Huawei Cloud). Other cloud platforms themselves have their own tokens and verification logic, and the token expiration time is also different. The existing technology cannot verify the cloud platform token and the expiration time of each platform token. Finally, the existing technology currently has most systems in enterprises that can only target their own platforms and does not include the Huawei Cloud platform. Huawei Cloud users must re-register as users of the company system or have enterprise maintenance personnel manually add users to log in to the company's application system, and they need to re-record a set of login passwords. For most users, it is troublesome and complicated to operate, which increases the operation and maintenance costs of the enterprise.
[0004] Therefore, it is necessary to improve the login method in the prior art to solve the above problems. Summary of the invention
[0005] In order to solve the problems raised in the above background technology, the present invention provides a Huawei cloud secondary login-free method based on Keycloak.
[0006] To achieve the above object, the present invention provides the following technical solutions: A method for freeing secondary login to Huawei Cloud based on Keycloak, comprising the following steps: Step S1: Assemble the Huawei cloud platform authentication interface address and initiate an authentication request to the Huawei cloud platform to implement Huawei cloud authentication.
[0007] Step S2: The user selects HUAWEI CLOUD as the identity authentication service. The front-end application sends the authentication request to Keycloak, which forwards it to HUAWEI CLOUD through the adapter. After the user completes the authentication, HUAWEI CLOUD returns the authentication result. Keycloak parses the authentication result and completes the login process.
[0008] S3. Exchange Access Token from Huawei Cloud through Code, verify and parse Access Token information, and process Access Token information.
[0009] Step S4: After receiving and verifying the Access Token returned by Huawei Cloud, obtain the user information and perform verification. After the verification is correct, process the obtained user information.
[0010] Step S5: Save and map the user data to the Keycloak database, create a login session, and then generate and distribute a token to the user's browser to implement single sign-on, so that the user's identity is automatically verified when accessing the integrated application to avoid repeated logins.
[0011] In a preferred embodiment of the present invention, step S1 comprises: S11. On the login page, the user selects HUAWEI CLOUD as the IdP and clicks the HUAWEI CLOUD Login button.
[0012] S12. The front-end page constructs a login request and sends it to Keycloak.
[0013] S13. After receiving the login request, Keycloak searches for and identifies the Huawei Cloud login adapter through the login adapter based on the built-in adapter mechanism.
[0014] S14. Assemble an authentication request.
[0015] S15. Use the Huawei Cloud Adapter to initiate an authentication request to Huawei Cloud and redirect the user's browser to the Huawei Cloud login interface. The user enters the user credentials on the cloud login interface.
[0016] In a preferred embodiment of the present invention, step S2 comprises: Step S21: The user enters the user credentials on the HUAWEI CLOUD login page and submits.
[0017] Step S22: After receiving the user credentials, HUAWEI CLOUD starts authentication.
[0018] Step S23: If the user authentication is successful, HUAWEI CLOUD will use the HTTP 302 status code to perform a redirect operation.
[0019] When redirecting, the Code is passed as a query parameter to the callback URL.
[0020] Step S24: If an error occurs during the authentication process, the Huawei Cloud service will pass the Error through the query parameter.
[0021] Step S25: Parse the query parameters in the URL.
[0022] Step S26: If the Error parameter exists and has a value, it indicates that the cloud verification has failed.
[0023] The reason for the failure is determined based on the value of the Error parameter. After the reason for the failure is determined, it is encapsulated as exception information. The exception information is sent back to the front-end page through the front-end for display to the user.
[0024] Step S27: If the Error parameter does not exist or is empty, it indicates that the user authentication is successful.
[0025] Extract the Code from the query parameters and use the Code to obtain the Access Token.
[0026] In a preferred embodiment of the present invention, step S3 comprises: S31. Use the Code obtained after user authentication to exchange it with the token endpoint of Huawei Cloud to obtain AccessToken.
[0027] S32. In the process of requesting Access Token, attach the client credentials to verify the legitimacy of the request.
[0028] S33. Once the Access Token returned by Huawei Cloud is received, the Access Token will be verified.
[0029] S34. Verification is successful, and relevant information in the Access Token is extracted.
[0030] S35. Use the obtained Access Token information to further process the user information.
[0031] In a preferred embodiment of the present invention, step S4 comprises: Step S41: Use the Access Token obtained from Huawei Cloud to access the user information endpoint.
[0032] Step S42: Initiate an authentication request to HUAWEI CLOUD to obtain user information.
[0033] Step S43: Verify the user information.
[0034] Step S45: When an error is found in the user information, error recording and exception handling are performed.
[0035] Step S46: When it is found that the user information is correct, the user information is mapped to the user model of Keycloak to facilitate creating or updating the user account in Keycloak.
[0036] In a preferred embodiment of the present invention, step S5 comprises: Step S51: Set the user information including user account, Chinese name, email address and mobile phone number to the Keycloak user context. At the same time, map the user account of Huawei Cloud to the username field of Keycloak to ensure the consistency of user identity.
[0037] Step S52: Generate a user login session in Keycloak based on the mapped user information, indicating that the user has logged in to Huawei Cloud.
[0038] Step S53: Synchronize the user's permissions in Huawei Cloud to Keycloak.
[0039] Step S54: After obtaining the permission of Huawei Cloud, Keycloak generates a token, which is used to verify the user's identity when the user accesses other applications integrated with Keycloak, achieving login-free access.
[0040] Step S55: distribute the token to the user's browser.
[0041] Step S56: When the user tries to access other applications that have been integrated with Keycloak, the application will check the validity of the token. If the token is valid, the user is allowed to access application resources without having to log in again.
[0042] In a preferred embodiment of the present invention, the user credentials include a user account and a user password.
[0043] In a preferred embodiment of the present invention, the client credentials include appId and appSecret, and the appId and appSecret are configuration information registered and provided in Huawei Cloud.
[0044] In a preferred embodiment of the present invention, a HUAWEI CLOUD secondary login-free device based on Keycloak comprises: The authentication request module is used to assemble the Huawei Cloud platform authentication interface address and send an authentication request to Huawei Cloud.
[0045] The module for receiving Huawei Cloud callback requests is used to parse the callback URL after Huawei Cloud authentication and check the authentication result.
[0046] The Token Acquisition module is used to initiate a request to Huawei Cloud to obtain an Access Token using the Code, appId, and appSecret parameters.
[0047] The HUAWEI CLOUD user information acquisition module is used to access the user information endpoint using the Access Token to acquire and process user information.
[0048] Set the Keycloak user information context module to save user information and generate a user login session, indicating that the user has logged in.
[0049] In a preferred embodiment of the present invention, a computer-readable storage medium stores program instructions therein, and when the program instructions are executed by a processor, a method for eliminating secondary login to Huawei Cloud based on Keycloak is implemented.
[0050] The present invention solves the defects existing in the background technology and has the following beneficial effects: 1. A method for avoiding secondary login to Huawei Cloud based on Keycloak. The present invention exchanges Token with Huawei Cloud based on Code through Keycloak, so that when the user accesses the subsystem, Keycloak will use Token to verify the user's identity, thereby avoiding the user's repeated input of the user name and password in each subsystem, reducing the user's login steps and improving login efficiency.
[0051] 2. This is a Huawei cloud secondary login-free method based on Keycloak. The present invention uses the authentication function of the Huawei cloud platform and Keycloak to enable users to obtain access to all other integrated systems by logging in to one system, thereby achieving single sign-on.
[0052] 3. This is a method for freeing a second login to Huawei Cloud based on Keycloak. The present invention allows users to log in using their existing credentials on the Huawei Cloud platform without creating an additional account, thereby simplifying the login process and improving the user experience. This reduces the need for new user registration and the resulting management costs.
[0053] 4. This is a Huawei cloud secondary login-free method based on Keycloak. The present invention performs Token storage and verification inside Keycloak, so that the storage and verification of tokens do not need to rely on third-party service storage, reducing system risks and operation and maintenance costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings: Figure 1 It is a modular design of a preferred embodiment of the present invention; Figure 2 is a flow chart of a preferred embodiment of the present invention; Figure 3 This is a flow chart of the system in the present invention logging into the Huawei cloud platform through Keycloak. DETAILED DESCRIPTION
[0055] The present invention will now be further described in detail with reference to the accompanying drawings and embodiments. These drawings are simplified schematic diagrams that only illustrate the basic structure of the present invention in a schematic manner, and therefore only show the components related to the present invention.
[0056] like Figure 1 , 2 As shown: A method for freeing secondary login to Huawei Cloud based on Keycloak, comprising the following steps: Step S1: Assemble the Huawei cloud platform authentication interface address and initiate an authentication request to the Huawei cloud platform to implement Huawei cloud authentication.
[0057] Step S2: The user selects HUAWEI CLOUD as the identity authentication service. The front-end application sends the authentication request to Keycloak, which forwards it to HUAWEI CLOUD through the adapter. After the user completes the authentication, HUAWEI CLOUD returns the authentication result. Keycloak parses the authentication result and completes the login process.
[0058] S3. Exchange Access Token from Huawei Cloud through Code, verify and parse Access Token information, and process Access Token information.
[0059] Step S4: After receiving and verifying the Access Token returned by Huawei Cloud, obtain the user information and perform verification. After the verification is correct, process the obtained user information.
[0060] Step S5: Save and map the user data to the Keycloak database, create a login session, and then generate and distribute a token to the user's browser to implement single sign-on, so that the user's identity is automatically verified when accessing the integrated application to avoid repeated logins.
[0061] In a preferred embodiment of the present invention, step S1 comprises: S11. On the login page, the user selects HUAWEI CLOUD as the IdP and clicks the HUAWEI CLOUD Login button.
[0062] S12. The front-end page constructs a login request and sends it to Keycloak.
[0063] S13. After receiving the login request, Keycloak searches for and identifies the Huawei Cloud login adapter through the login adapter based on the built-in adapter mechanism.
[0064] S14. Assemble an authentication request.
[0065] S15. Use the Huawei Cloud Adapter to initiate an authentication request to Huawei Cloud and redirect the user's browser to the Huawei Cloud login interface. The user enters the user credentials on the cloud login interface.
[0066] In a preferred embodiment of the present invention, step S2 comprises: Step S21: The user enters the user credentials on the HUAWEI CLOUD login page and submits.
[0067] Step S22: After receiving the user credentials, HUAWEI CLOUD starts authentication.
[0068] Step S23: If the user authentication is successful, HUAWEI CLOUD will use the HTTP 302 status code to perform a redirect operation.
[0069] When redirecting, the Code is passed as a query parameter to the callback URL.
[0070] Step S24: If an error occurs during the authentication process, the Huawei Cloud service will pass the Error through the query parameter.
[0071] Step S25: Parse the query parameters in the URL.
[0072] Step S26: If the Error parameter exists and has a value, it indicates that the cloud verification has failed.
[0073] The reason for the failure is determined based on the value of the Error parameter. After the reason for the failure is determined, it is encapsulated as exception information. The exception information is sent back to the front-end page through the front-end for display to the user.
[0074] Step S27: If the Error parameter does not exist or is empty, it indicates that the user authentication is successful.
[0075] Extract the Code from the query parameters and use the Code to obtain the Access Token.
[0076] In a preferred embodiment of the present invention, step S3 comprises: S31. Use the Code obtained after user authentication to exchange it with the token endpoint of Huawei Cloud to obtain AccessToken.
[0077] S32. In the process of requesting Access Token, attach the client credentials to verify the legitimacy of the request.
[0078] S33. Once the Access Token returned by Huawei Cloud is received, the Access Token will be verified.
[0079] S34. Verification is successful, and relevant information in the Access Token is extracted.
[0080] S35. Use the obtained Access Token information to further process the user information.
[0081] In a preferred embodiment of the present invention, step S4 comprises: Step S41: Use the Access Token obtained from Huawei Cloud to access the user information endpoint.
[0082] Step S42: Initiate an authentication request to HUAWEI CLOUD to obtain user information.
[0083] Step S43: Verify the user information.
[0084] Step S45: When an error is found in the user information, error recording and exception handling are performed.
[0085] Step S46: When it is found that the user information is correct, the user information is mapped to the user model of Keycloak to facilitate creating or updating the user account in Keycloak.
[0086] In a preferred embodiment of the present invention, step S5 comprises: Step S51: Set the user information including user account, Chinese name, email address and mobile phone number to the Keycloak user context. At the same time, map the user account of Huawei Cloud to the username field of Keycloak to ensure the consistency of user identity.
[0087] Step S52: Generate a user login session in Keycloak based on the mapped user information, indicating that the user has logged in to Huawei Cloud.
[0088] Step S53: Synchronize the user's permissions in Huawei Cloud to Keycloak.
[0089] Step S54: After obtaining the permission of Huawei Cloud, Keycloak generates a token, which is used to verify the user's identity when the user accesses other applications integrated with Keycloak, achieving login-free access.
[0090] Step S55: distribute the token to the user's browser.
[0091] Step S56: When the user tries to access other applications that have been integrated with Keycloak, the application will check the validity of the token. If the token is valid, the user is allowed to access application resources without having to log in again.
[0092] In a preferred embodiment of the present invention, the user credentials include a user account and a user password.
[0093] In a preferred embodiment of the present invention, the client credentials include appId and appSecret, and appId and appSecret are configuration information registered and provided in Huawei Cloud.
[0094] In a preferred embodiment of the present invention, a HUAWEI CLOUD secondary login-free device based on Keycloak includes: The authentication request module is used to assemble the Huawei Cloud platform authentication interface address and send an authentication request to Huawei Cloud.
[0095] The module for receiving Huawei Cloud callback requests is used to parse the callback URL after Huawei Cloud authentication and check the authentication result.
[0096] The Token acquisition module is used to initiate a request to Huawei Cloud to obtain a Token using the Code, appId, and appSecret parameters.
[0097] The HUAWEI CLOUD user information acquisition module is used to access the user information endpoint using the Access Token to acquire and process user information.
[0098] Set the Keycloak user information context module to save user information and generate a user login session, indicating that the user has logged in.
[0099] In a preferred embodiment of the present invention, a computer-readable storage medium stores program instructions therein, and when the program instructions are executed by a processor, a method for eliminating secondary login to Huawei Cloud based on Keycloak is implemented. Embodiment 1
[0100] like Figure 3 As shown in the following example, in a specific scenario, an enterprise has multiple systems, including a CRM system, a configuration center, and a form designer, each of which requires a user to log in to access. All systems use Keycloak as a unified identity verification and single sign-on service provider.
[0101] Before logging into the CRM system, users select HUAWEI Cloud as the cloud login method on the login page and initiate a login request through Keycloak.
[0102] After receiving the login request, Keycloak searches for and identifies the Huawei Cloud login adapter through the login adapter based on the built-in adapter mechanism, and uses the Huawei Cloud adapter to initiate an authentication request to Huawei Cloud. At the same time, it redirects the user's browser to the Huawei Cloud login interface; the Huawei Cloud login interface includes an input form, and the user enters the account and password in the input form.
[0103] The user enters the account and password on the HUAWEI CLOUD login page and submits it. After HUAWEI CLOUD receives the account and password, it starts the authentication process.
[0104] After the user is successfully authenticated, Huawei Cloud Platform passes the Code to Keycloak to further obtain the AccessToken.
[0105] Keycloak sends the code to the token endpoint of Huawei Cloud and appends the appId and appSecret. After receiving and verifying the Access Token returned by Huawei Cloud, Keycloak obtains the user information and performs verification. After the verification is completed, the user information is mapped and synchronized to Keycloak. Keycloak sets the user information including user account, Chinese name, email address and mobile phone number to the Keycloak user context. At the same time, the user account of Huawei Cloud is mapped to the username field of Keycloak to ensure the consistency of user identity. Based on the mapped user information, a user login session is generated in Keycloak, indicating that the user has logged in to Huawei Cloud; When the user logs in to the CRM system for the second time, Keycloak generates a code and sends it to the front-end interface of the CRM system. The user needs to enter the code to complete the login process.
[0106] After the CRM system front end receives the Code entered by the user, it sends the Code to Keycloak to obtain a Token.
[0107] After Keycloak verifies that the Code is correct, it generates a Session and Cookie for the user. The Cookie contains the identification information of the session.
[0108] Keycloak sends the Token back to the CRM system, which uses the Token to verify the user's identity and obtain user information.
[0109] The CRM system saves the received Token in the server-side cache for authentication when the user accesses other resources.
[0110] After a user successfully logs in to the CRM system, when the user accesses the form designer or configuration center, the user's browser sends cookies to Keycloak.
[0111] Keycloak checks the session ID in the cookie sent by the user's browser and verifies the validity of the session. If the session is valid, it means that the user has logged into the CRM system. At this time, Keycloak will return a token to allow the user to log in to the form designer and configuration center.
[0112] Keycloak's session management mechanism allows users to stay logged in between different applications without having to re-enter their credentials. Through the above steps, users can avoid having to log in twice when accessing various applications that have been integrated with Keycloak.
[0113] In the description of the present invention, it should be understood that the terms first and second are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, features defined as first and second may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of multiple is two or more, unless otherwise clearly and specifically defined.
[0114] In the description of this specification, the description of the terms one embodiment, some embodiments, embodiments, examples, specific examples or some examples, etc., means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example.
[0115] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may alter, modify, replace and modify the above embodiments within the scope of the present invention.
Claims
1. A method for freeing secondary login to Huawei Cloud based on Keycloak, characterized in that: Includes steps: Step S1: Assemble the Huawei cloud platform authentication interface address and initiate an authentication request to the Huawei cloud platform to implement Huawei cloud authentication; Step S2: The user selects HUAWEI CLOUD as the identity authentication service. The front-end application sends the authentication request to Keycloak, which forwards it to HUAWEI CLOUD through the adapter. After the user completes the authentication, HUAWEI CLOUD returns the authentication result. Keycloak parses the authentication result and completes the login process. S3, exchanges Access Token from Huawei Cloud through Code, verifies and parses Access Token information, and processes Access Token information; Step S4: After receiving and verifying the Access Token returned by Huawei Cloud, obtain the user information and perform verification; after the verification is correct, process the obtained user information; Step S5: Save and map the user data to the Keycloak database, create a login session, and then generate and distribute a token to the user's browser to implement single sign-on, so that the user's identity is automatically verified when accessing the integrated application to avoid repeated logins.
2. According to claim 1, a method for Huawei Cloud secondary login-free based on Keycloak is characterized in that: Step S1 includes: S11. On the login page, the user selects HUAWEI CLOUD as the IdP and clicks the HUAWEI CLOUD Login button. S12. The front-end page constructs a login request and sends it to Keycloak; S13. After receiving the login request, Keycloak searches for and identifies the Huawei Cloud login adapter through the login adapter based on the built-in adapter mechanism. S14, assembling an authentication request; S15. Use the Huawei Cloud Adapter to initiate an authentication request to Huawei Cloud and redirect the user's browser to the Huawei Cloud login interface; the user enters the user credentials on the cloud login interface.
3. According to claim 1, a method for Huawei Cloud secondary login-free based on Keycloak is characterized in that: Step S2 includes: Step S21: The user enters the user credentials on the HUAWEI CLOUD login page and submits them. Step S22: After receiving the user credentials, HUAWEI CLOUD starts authentication; Step S23: If the user authentication is successful, HUAWEI CLOUD will use the HTTP 302 status code to perform a redirect operation; When redirecting, the Code is passed as a query parameter to the callback URL; Step S24: If an error occurs during the authentication process, the Huawei Cloud service will pass the Error through the query parameter; Step S25, parsing the query parameters in the URL; Step S26: If the Error parameter exists and has a value, it indicates that the cloud verification has failed; Determine the cause of failure based on the value of the Error parameter; after determination, encapsulate the cause of failure as exception information; send the exception information back to the front-end page through the front-end for display to the user; Step S27: If the Error parameter does not exist or is empty, it indicates that the user authentication is successful; Extract the Code from the query parameters; use the Code to obtain the Access Token.
4. According to claim 1, a method for Huawei Cloud secondary login-free based on Keycloak is characterized in that: Step S3 includes: S31. Use the Code obtained after user authentication to exchange with the token endpoint of Huawei Cloud to obtain AccessToken; S32. In the process of requesting Access Token, attach the client credentials to verify the legitimacy of the request; S33. Once the Access Token returned by Huawei Cloud is received, the Access Token will be verified; S34. If verification is successful, extract relevant information from the Access Token; S35. Use the obtained Access Token information to further process the user information.
5. According to claim 2, a method for free secondary login to Huawei Cloud based on Keycloak is characterized in that: Step S4 includes: Step S41: Use the Access Token obtained from Huawei Cloud to access the user information endpoint; Step S42: Initiate an authentication request to HUAWEI CLOUD to obtain user information; Step S43: verifying user information; Step S45: When an error is found in the user information, error recording and exception handling are performed; Step S46: When it is found that the user information is correct, the user information is mapped to the user model of Keycloak to facilitate creating or updating the user account in Keycloak.
6. According to claim 1, a method for Huawei Cloud secondary login-free based on Keycloak is characterized in that: Step S5 includes: Step S51: Set the user information including user account, Chinese name, email address and mobile phone number to the Keycloak user context; at the same time, map the user account of Huawei Cloud to the username field of Keycloak to ensure the consistency of user identity; Step S52: Generate a user login session in Keycloak based on the mapped user information, indicating that the user has logged in to HUAWEI CLOUD. Step S53: Synchronize the user's permissions in Huawei Cloud to Keycloak; Step S54: After obtaining the permission of Huawei Cloud, Keycloak generates a token, which is used to verify the user's identity when the user accesses other applications integrated with Keycloak, achieving login-free access; Step S55, distributing the token to the user's browser; Step S56: When the user tries to access other applications that have been integrated with Keycloak, the application will check the validity of the token. If the token is valid, the user is allowed to access application resources without having to log in again.
7. According to claim 3, a method for Huawei Cloud secondary login-free based on Keycloak is characterized in that: The user credentials include a user account and a user password.
8. According to claim 4, a method for freeing secondary login to Huawei Cloud based on Keycloak is characterized in that: The client credentials include appId and appSecret, and the appId and appSecret are configuration information registered and provided in Huawei Cloud.
9. A Huawei Cloud secondary login-free device based on Keycloak, characterized in that: The device comprises: The authentication request module is used to assemble the Huawei Cloud platform authentication interface address and send an authentication request to Huawei Cloud. The module for receiving Huawei Cloud callback requests is used to parse the callback URL after Huawei Cloud authentication and check the authentication result. The Token acquisition module is used to initiate a request to Huawei Cloud to obtain an Access Token using the Code, appId, and appSecret parameters. Get Huawei Cloud user information module, used to use Access Token to access the user information endpoint, obtain and process user information Set the Keycloak user information context module to save user information and generate a user login session, indicating that the user has logged in.
10. A computer-readable storage medium having program instructions stored therein, characterized in that: When the program instructions are executed by a processor, the method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Single-point authentication method and system for user access and medium
CN116028915A
Authentication method and device suitable for cloud product and storage medium
CN116170201A
Secondary login-free method for Superset based on Keyblock
CN116389118A
Login method
CN117201173A
