
Most of the copy is duplicated except for the places where it matters. This allows for any page of this documentation to be page one. If someone only cares about using hosts first, they can go directly there and start listing hosts, creating them, etc. without much other prompting. Change-Id: Id621947af5d4c3ca53af24904f5f16d3d88bc8b8
1.5 KiB
1.5 KiB
Authenticating to Craton
There are two ways to authenticate to Craton:
- Using Craton's in-built authentication system (the default)
- Using Keystone
Craton Authentication
In the Craton Authentication case, you need the URL for the Craton API service, your username, project ID, and token. To set up cratonclient for this authentication, you need only do the following:
from cratonclient import auth
from cratonclient.v1 import client
= auth.craton_auth(
craton_session =USERNAME,
username=TOKEN,
token=PROJECT_ID,
project_id
)
= client.Client(
craton =craton_session,
session=URL,
url )
Keystone Authentication
When authenticating to Craton using Keystone, you need to know:
- the URL to use to authenticate to Keystone which we will refer to as
AUTH_URL
- the username
- the password
- the project ID or name
- the user domain ID or name
- and the project domain ID or name
Then, we need to do the following:
from cratonclient import auth
from cratonclient.v1 import client
= auth.keystone_auth(
craton_session =AUTH_URL,
auth_url=PASSWORD,
password=USERNAME,
username=USER_DOMAIN_NAME,
user_domain_name=PROJECT_NAME,
project_name=PROJECT_DOMAIN_NAME,
project_domain_name
)= client.Client(
craton =craton_session,
session=URL,
url )