Authenticate as a data engineer
1
Sign in as yourself
To sign in as yourself, use a persisted Cognite identity provider (CogIdP) session. Run:The command opens a browser so you can sign in. It then asks which CDF project to use. Save the project and cluster to
Sign-in flow
.env so the Cognite Toolkit selects them the next time you run a command.2
Check your authentication
Check your authentication:The command prints whether you are signed in, the identity provider, the project, and when the access token expires. It then lists each CDF project you can access, how many capabilities you have there, and which groups you belong to.
--verbose prints every capability on the token. --show-missing adds a row for every Cognite Toolkit resource. Read and Write show the capabilities behind that access. No access means the token cannot read or write that resource type.3
Sign out
To sign out, run:This removes the persisted CogIdP session. Sign in again before the next Cognite Toolkit command that needs CDF.
Authenticate as a Cognite Toolkit administrator
Create the identity provider application and store its client ID and client secret before these steps. See Authentication and authorization.1
Create the .env file
A Cognite Toolkit administrator uses credentials that a CI/CD pipeline can reuse. Run:The wizard writes a
.env file and checks that the credentials can reach CDF.Init flow
The credentials are valid. means the Cognite Toolkit exchanged the client credentials for a token. The .env file contains the client secret. Do not commit it.2
Create the Cognite Toolkit group
cdf auth verify does not create the identity provider application. It checks the CDF group that the service account should use, and can create or update that group.The group name is fixed: cognite_toolkit_service_principal. The service account should be a member of only that group, and the group should be able to manage the resources the Cognite Toolkit deploys.Run:sourceId). If the group exists and is missing capabilities, the wizard lists the resources those capabilities unlock and asks whether to add them.3
Update authorization
When a newer Cognite Toolkit version supports more resources, run Accept the prompt to add the missing capabilities to
cdf auth verify again. The command compares the group with the capabilities the current CLI expects:Update authorization
cognite_toolkit_service_principal. Deploy and clean can then manage the new resource types.