What is the common method for openstack4j to establish a common authenticated connection
Today, I will talk to you about openstack4j to establish a general authentication connection public method, many people may not understand, in order to make you better understand, the editor summed up the following, I hope you can get something according to this article.
Introduction to the basic concepts of keystone
To access certain services, the user provides credentials to Keystone and receives tokens. A token is just a string that connects internally to users and tenants through Keystone. With requests generated by each user request or service, this token is passed between services to another service to process the user's request. Users find the URL of the service they need. For example, if the user wants to generate a new VM instance in Nova, he can find the URL pointing to Nova in the list of endpoints provided by Keystone and send the corresponding request. After that, Nova verifies the validity of the tokens in Keystone and should create an instance from an image based on the provided image ID and plug it into a network. Initially, Nova passes this tag to Glance to get the image stored somewhere in it. It then asks Quantum to plug the new instance into the network; Quantum verifies that users have access to the network and VM interfaces in their databases by requesting information in Nova. This token moves throughout the process between services so that they can ask Keystone or each other for additional information or certain actions.
Directly add the code / * establish authentication connection * * / public OSClientV3 getOSClientV3 (String tenantId,String userid, String password,String region) {String url = "http://127.0.0.1:5000/v3";if (tenantId = = null | | tenantId.equals (")) {tenantId = "defaultTenantId" } OSClientV3 osv3 = OSFactory.builderV3 (). Endpoint (url) .scope (userid, password) .scopeToProject (Identifier.byId (tenantId)) .authenticate (); if (region! = null & &! ".equals (region)) {osv3.useRegion (region);} return osv3 } after reading the above, do you have any further understanding of what is the common way for openstack4j to establish an authenticated connection? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.